开发者

Running ruby 1.9.2 on Heroku

I'm trying to create a new app on heroku but it seems no matter what I do heroku runs ruby 1.9.1 rather than 1.9.2

I've created my app...

heroku create writings --stack cedar

Then I've pushed my develop branch to master on heroku for testing

git push heroku develop:master

But the app runs with errors... looking in the开发者_如何学运维 heroku logs.. this seems to be the offending error.

 /app/vendor/bundle/ruby/1.9.1/gems/execjs-1.1.3/lib/execjs/runtimes.rb:43:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)

Which shows that it's running ruby 1.9.1 does it not?

If I run heroku config it shows...

heroku config
DATABASE_URL        => postgres://mxlvaczibv:wMtsU7TrPMQM5n-X5SfX@ec2-50-19-226-179.compute-1.amazonaws.com/mxlvaczibv
GEM_PATH            => vendor/bundle/ruby/1.9.1
LANG                => en_US.UTF-8
PATH                => vendor/bundle/ruby/1.9.1/bin:/usr/local/bin:/usr/bin:/bin
RACK_ENV            => production
RAILS_ENV           => production
SHARED_DATABASE_URL => postgres://mxlvaczibv:wMtsU7TrPMQM5n-X5SfX@ec2-50-19-226-179.compute-1.amazonaws.com/mxlvaczibv

Is this not showing it is running 1.9.1? I'm totally confused... I thought the cedar stack ran 1.9.2. Any help appreciated.

Thanks, mark.


It does not show that it is running Ruby 1.9.1. Because the standard library changed very little between 1.9.1 and 1.9.2, the same path is used for both of them. You will notice this is not just on Heroku.

It looks like execjs is expecting to have a JS runtime installed on the system. Apparently Celadon Cedar does have one (NodeJS), but it won't work until rails 3.1rc5 arrives. Until then, follow the intructions in this answer.


I am using Ruby 1.9.2 and Heroku as well. I have this in my Gemfile. I remember having some sort of javascript errors when trying to deploy to Heroku before as well, I'm pretty sure this solved it.

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


Try using:

heroku create --stack bamboo-mri-1.9.2
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜