【问题标题】:Ruby version is not upgrading on HerokuRuby 版本未在 Heroku 上升级
【发布时间】:2012-08-16 16:32:59
【问题描述】:

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

我关注了关于 heroku 的文章: 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'

我正在使用最新版本的捆绑程序:

bundle -v
Bundler version 1.2.0.rc.2

我猜我有正确的 ruby​​ 路径(如文章中所示):

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

知道我应该运行什么来强制升级到 Ruby 1.9.3 吗?

谢谢!

【问题讨论】:

    标签: ruby-on-rails heroku


    【解决方案1】:

    我没有认真阅读文档。

    我的 heroku PATH 是

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

    文档说:

    如果不存在或不是第一个条目,请使用 heroku 在配置中添加 bin: 配置:添加。 $ heroku 配置:添加 PATH=bin:vendor/bundle/ruby/1.9.1/bin:/usr/local/bin:/usr/bin:/bin

    不是 first entry 术语(不像我想的那样简单地 present),显然我需要在 PATH 前面添加“bin”。

    【讨论】:

      【解决方案2】:

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

      【讨论】:

      • 我的 ruby​​ PATH 中缺少 bin/ 路径,请参阅我的回答 :) 感谢您的帮助!
      猜你喜欢
      • 2014-01-14
      • 1970-01-01
      • 2020-05-27
      • 2016-10-05
      • 2020-12-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多