rake aborted! ,, Could not find a JavaScript runtime. See,https://github.com/sstephenson/execjs, for a list of available runtimes.

You need a javascript engine for rails 3.1 (heroku doesn't have one), and it appears that the javascript engine that works with Heroku is the rubyracer for heroku.

Rails uses execjs to execute javascript and execjs supports 7 javascript engines. Node.js is one, and rubyracer is one.

Gerred Dillon had a similar problem and wrote about it. In the comment section a point was raised about making this a production only change, since you already have nodejs as your local javascript engine. So the relevant code is:

group :production do   gem 'therubyracer-heroku', '0.8.1.pre3' end 

UPDATE: Heroku has a new stack, called Cedar, that they recommend for Rails 3.1.0. Heroku also has a doc about upgrading to Rails 3.1.0 rc5. They recommend not using 'therubyracer-heroku' gem anymore as it's not necessary with rc5. Also, make sure to update your config/application.rb file if you're upgrading from an older rc. Also, if you are upgrading from an older rc, run this command:

heroku config:add PATH=vendor/bundle/ruby/1.9.1/bin:/usr/local/bin:/usr/bin:/bin:bin

Comments

Popular posts from this blog

Rails Memcache issues

Enabling password authentication for new ec2 box | ssh, ssh config, EC2 setup, new user in EC2, PasswordAuthentication

What's the difference between "include" and "require" in Ruby?