Ruby版本没有在Heroku上升级

时间:2012-08-16 16:33:00

标签: ruby-on-rails heroku

我已将我的应用程序从ruby 1.9.2升级到heroku上的ruby 1.9.3。

我跟着关于它的关于它的文章: https://devcenter.heroku.com/articles/ruby-versions

当我部署我的应用程序时,我没有收到任何错误:

> -----> Ruby/Rails app detected
> -----> Using Ruby version: ruby-1.9.3
> -----> Installing dependencies using Bundler version 1.2.0.rc.2 Running: bundle install --without development:test --path
> vendor/bundle --binstubs bin/ --deployment Fetching gem metadata from
> http://rubygems.org/....... Fetching gem metadata from
> http://rubygems.org/.. Using rake (0.9.2.2) Using i18n (0.6.0)
> ..............
> -----> Discovering process types Procfile declares types -> worker Default types for Ruby/Rails -> console, rake, web
> -----> Compiled slug size is 27.0MB
> -----> Launching... done, v157 http://riskyshower.herokuapp.com deployed to Heroku

但是应用程序无法正常启动,如果我拖尾日志,我会看到以下内容:

2012-08-16T10:21:26+00:00 heroku[router]: Error H10 (App crashed) -> GET my_domain.me/ dyno= queue= wait= service= status=503 bytes=
2012-08-16T10:21:27+00:00 heroku[router]: Error H10 (App crashed) -> GET my_domain.me/favicon.ico dyno= queue= wait= service= status=503 bytes=

我无法获得更多信息告诉我出了什么问题,但我认为Ruby没有正确升级,因为当我这样做时:

heroku run "ruby -v"
Running ruby -v attached to terminal... up, run.1
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]

当它应该是1.9.3

在我的Gemfile顶部,我有:

source 'http://rubygems.org'
ruby '1.9.3'

我正在使用最新版本的bundler:

bundle -v
Bundler version 1.2.0.rc.2

我猜有正确的红宝石路径(就像在文章中一样):

heroku config -s | grep PATH
PATH=vendor/bundle/ruby/1.9.1/bin:/usr/local/bin:/usr/bin:/bin:bin

关于我应该运行什么以强制升级到Ruby 1.9.3的任何想法?

谢谢!

2 个答案:

答案 0 :(得分:3)

我没有仔细阅读文档。

我的heroku PATH是

vendor/bundle/ruby/1.9.1/bin:/usr/local/bin:/usr/bin:/bin

文档说:

  

如果没有或没有第一个条目,请使用heroku将bin:添加到配置中   配置:添加。 $ heroku config:add   PATH =仓:供应商/束/红宝石/ 1.9.1 / bin中:在/ usr / local / bin中:在/ usr / bin中:/ bin中

不是第一个条目一词(不是简单的现在),显然我需要在PATH前添加'bin'。

答案 1 :(得分:2)

你确定你在Cedar堆栈上吗?我相信这是你可以在Heroku上设置Ruby版本的唯一方法。如果没有,切换到Cedar堆栈可能会解决您的问题。