Help us understand the problem. What is going on with this article?

rails sコマンド実行時に「Could not find a JavaScript runtime.」とエラーが出る場合の対処法

More than 3 years have passed since last update.
$ rails s
/usr/local/rvm/gems/ruby-2.1.5/gems/execjs-2.6.0/lib/execjs/runtimes.rb:48:in `autodetect': Could not find a JavaScript runtime. See for a list of available runtimes. (ExecJS::RuntimeUnavailable)
        from /usr/local/rvm/gems/ruby-2.1.5/gems/execjs-2.6.0/lib/execjs.rb:5:in `<module:ExecJS>'
        from /usr/local/rvm/gems/ruby-2.1.5/gems/execjs-2.6.0/lib/execjs.rb:4:in `<top (required)>'
        from bin/rails:4:in `require'
        from bin/rails:4:in `<main>'

Gemfileにgem 'therubyracer'という記述を追加して、bundle update以降の手順を同様に実行する。


GitHub execjs



(EC2 - Amazon Linuxの場合)

$ yum install nodejs --enablerepo=epel


中野システム研究所、所長(仮) 東京四念処禅道場、師範(仮)
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away