LoginSignup
4
5

More than 5 years have passed since last update.

Could not find a JavaScript runtime

Last updated at Posted at 2012-08-20

Rails3にて、以下のエラーが出た場合、JavaScript Runtimeをインストールする必要がある。

Could not find a JavaScript runtime

方法としては、Node.jsをインストールするか、Gemfileでtherubyracerのインストールを有効にするのが楽と思う。

Node.jsを利用する場合

Node.js公式サイト

cd
wget http://nodejs.org/dist/v0.8.7/node-v0.8.7.tar.gz
tar zxvf node-v0.8.7.tar.gz
cd node-v0.8.7
./configure
make
sudo make install
make clean

therubyracerを利用する場合

Rails3プロジェクトにあるGemfileに、以下のような記述があるので、コメントアウトを外す。

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'therubyracer', :platforms => :ruby

4
5
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
4
5