Rails3にて、以下のエラーが出た場合、JavaScript Runtimeをインストールする必要がある。
Could not find a JavaScript runtime
方法としては、Node.jsをインストールするか、Gemfileでtherubyracerのインストールを有効にするのが楽と思う。
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