LoginSignup
0
0

More than 3 years have passed since last update.

rails s すると Could not find a JavaScript runtime

Posted at

問題

rails s を実行すると

/Users/username/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:58:in `autodetect': 
Could not find a JavaScript runtime.
https://github.com/rails/execjs for a list of available runtimes.

となり、実行できない

rubyからjavascriptを呼び出せていない

解決

Gemfileにある

# gem 'therubyracer', platforms: :ruby

のコメントアウトを解除する。

therubyracerはjavascriptのv8エンジンを使用して、javascriptを有効にできるGem
therubyracer参考
v8エンジン参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0