ExecJS::RuntimeUnavailable error when I start the Rails server

送分小仙女□ 提交于 2019-12-05 17:49:56

Try

sudo gem install therubyracer

or

gem install therubyracer

Hope this helps

If you've just generated a new application, this can come up when the gem therubyracer is commented. It is needed to compile your assets. You can uncomment that or install something like nodejs so you won't need to use the gem in all of your projects.

brew install nodejs
# or
sudo apt-get install nodejs
Lucio

The most popular JavaScript runtime is therubyracer which is a gem. As @muttonlamb said, install it running:

gem install therubyracer

Then, as Bathakarai mentioned, add the next line into your Gemfile at the bottom of the file:

gem 'therubyracer'

Now run rails server again and everything should be working.

To simplify the process you can run a script to generate the app and add the JS runtime automatically.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!