rake assets:precompile
for my rails project throws below error:
rake aborted! Current ExecJS runtime does't support ES6. Please install latest Node.js.
Below is the environment information:
rails -v
Rails 5.0.7
ruby -v
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]
node -v
v6.11.1
I tried reinstalling all my gems. But still, the error comes. OS is RHEL.
therubyracer (V8) runtime does’t support ES6. Please update or replace your current ExecJS runtime. I can't use mini_racer. Can you help me please?)
Then that wouldn't work due to this error: ExecJS::RubyRacerRuntime is not supported. Please replace therubyracer with mini_racer in your Gemfile or use Node.js as ExecJS runtime.
ES5 code is the JS syntax style that is readable to node.js, such as module.exports or var module = require ('module') . Note that in today’s time, almost 99% of ES6+ syntax can be used in Node.js. This is where the package called babel shines.
@jcoyne updating ExecJS runtime is always the good idea ;). Anyway, Autoprefixer JS code just needs ES6. Sorry, something went wrong. Sorry, something went wrong. Maybe we need to change error text. Do you want to send PR? Sorry, something went wrong. Sorry, something went wrong. @jankmet @caiotarifa does somebody want to make warning smarter?
I had a similar problem after upgrading to Rails 5.2
The solution for me was to add this line
# make the ExecJs use NodeJs
ENV['EXECJS_RUNTIME'] = 'Node'
In this file
config/boot.rb
Then restart the rails server
There's been a similar issue opened in the Autoprefixer-rails gem regarding this error, but it was thrown from an ActionView Template. keep an eye out for a response from the contributor:
https://github.com/ai/autoprefixer-rails/issues/137
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With