简体   繁体   中英

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

尝试使用:

heroku create --stack bamboo-mri-1.9.2

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM