【问题标题】:Heroku cedar doesn't upgrade to ruby-1.9.3Heroku cedar 没有升级到 ruby​​-1.9.3
【发布时间】:2012-07-25 22:23:30
【问题描述】:

尝试将 Heroku cedar 从 Ruby 1.9.2 移植到 Ruby 1.9.3 失败:

2012-07-25T22:09:48+00:00 heroku[slugc]: Slug compilation started
2012-07-25T22:11:23+00:00 heroku[api]: Deploy abdaf18 by luca.soave@gmail.com
2012-07-25T22:11:23+00:00 heroku[api]: Release v244 created by luca.soave@gmail.com
2012-07-25T22:11:23+00:00 heroku[web.1]: State changed from up to starting
2012-07-25T22:11:24+00:00 heroku[deployhooks]: Notified New Relic about the deploy
2012-07-25T22:11:24+00:00 heroku[slugc]: Slug compilation finished
2012-07-25T22:11:26+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2012-07-25T22:11:27+00:00 app[web.1]: Exiting
2012-07-25T22:11:28+00:00 heroku[web.1]: Process exited with status 0
2012-07-25T22:11:28+00:00 heroku[web.1]: Starting process with command `bundle exec rails server thin -p 12558`
2012-07-25T22:11:29+00:00 app[web.1]: Your Ruby version is 1.9.2, but your Gemfile specified 1.9.3
2012-07-25T22:11:30+00:00 heroku[web.1]: Process exited with status 18
2012-07-25T22:11:30+00:00 heroku[web.1]: State changed from starting to crashed
2012-07-25T22:11:30+00:00 heroku[web.1]: State changed from crashed to starting
2012-07-25T22:11:36+00:00 heroku[web.1]: Starting process with command `bundle exec rails server thin -p 36407`
2012-07-25T22:11:37+00:00 app[web.1]: Your Ruby version is 1.9.2, but your Gemfile specified 1.9.3
2012-07-25T22:11:39+00:00 heroku[web.1]: Process exited with status 18
2012-07-25T22:11:39+00:00 heroku[web.1]: State changed from starting to crashed
2012-07-25T22:11:40+00:00 heroku[router]: Error H10 (App crashed) -> GET gitwatcher.herokuapp.com/ dyno= queue= wait= service= status=503 bytes=
2012-07-25T22:11:41+00:00 heroku[router]: Error H10 (App crashed) -> GET gitwatcher.herokuapp.com/favicon.ico dyno= queue= wait= service= status=503 bytes=
2012-07-25T22:11:41+00:00 heroku[router]: Error H10 (App crashed) -> GET gitwatcher.herokuapp.com/favicon.ico dyno= queue= wait= service= status=503 bytes=

更新

我关注了Heroku docs

ruby '1.9.3'

进入我的 Gemfile 和 bundler --pre

lsoave@ubuntu:~/rails/github/gitwatcher$ gem list bundler

*** LOCAL GEMS ***

bundler (1.2.0.pre.1, 1.1.4)
lsoave@ubuntu:~/rails/github/gitwatcher$

更新

我遵循了 heroku 的建议:If absent or not the first entry, add bin: to the config with heroku config:add. 但它不起作用:

lsoave@ubuntu:~/rails/github/gitwatcher$ heroku config -s | grep PATH
GEM_PATH=vendor/bundle/ruby/1.9.1
PATH=bin:vendor/bundle/ruby/1.9.1/bin:/usr/local/bin:/usr/bin:/bin
lsoave@ubuntu:~/rails/github/gitwatcher$ 

...这很奇怪,因为在控制台中运行 ruby​​ -v 会返回正确的版本:

lsoave@ubuntu:~/rails/github/gitwatcher$ heroku run:detached "ruby -v"
Running `ruby -v` detached... up, run.1
Use `heroku logs -p run.1` to view the output.
lsoave@ubuntu:~/rails/github/gitwatcher$ heroku logs -p run.1
2012-07-25T22:51:57+00:00 heroku[run.1]: Starting process with command `ruby -v`
2012-07-25T22:51:57+00:00 app[run.1]: ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
2012-07-25T22:51:57+00:00 heroku[run.1]: State changed from starting to complete
2012-07-25T22:51:58+00:00 heroku[run.1]: Process exited with status 0
lsoave@ubuntu:~/rails/github/gitwatcher$ 

更新

...而且我做到了:

heroku config:add RUBY_VERSION=ruby-1.9.3-p194
heroku config:add PATH=bin:vendor/bundle/ruby/1.9.1/bin:/usr/local/bin:/usr/bin:/bin
recompile ( change + git commit + git push heroku +master )

但没有,这样重新编译后它会崩溃:

2012-07-25T23:18:47+00:00 heroku[router]: Error H10 (App crashed) -> GET gitwatcher.com/ dyno= queue= wait= service= status=503 bytes=
2012-07-25T23:18:47+00:00 heroku[nginx]: 93.34.152.105 - - [25/Jul/2012:23:18:47 +0000] "GET / HTTP/1.1" 503 601 "-" "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:14.0) Gecko/20100101 Firefox/14.0.1" gitwatcher.com

更新

打开 Heroku 调用请求 #58410

【问题讨论】:

  • 您是否按照devcenter.heroku.com/articles/ruby-versions#troubleshooting 更新了您的PATH
  • 不,我没有……我正在尝试
  • @matt 完成,但它不起作用
  • 也许你需要重新编译你的 slug?尝试做一个小改动并推送一个新版本。
  • 完成但什么也没做...见更新

标签: ruby-on-rails ruby deployment heroku


【解决方案1】:

这不是 ruby​​ 版本的问题,实际上我在 heroku 编译期间注意到以下错误,即使它没有阻止部署并且推送完成而没有其他问题:

-----> Preparing app for Rails asset pipeline

      Running: rake assets:precompile

      rake aborted!

      Invalid CSS after "...nd-image:url(""": expected ")", was "/assets/twitter..."

      (in /tmp/build_19ypab978ku1z/app/assets/stylesheets/application.css)

      Tasks: TOP => assets:precompile:primary

      (See full trace by running task with --trace)

      Precompiling assets failed, enabling runtime asset compilation

      Injecting rails31_enable_runtime_asset_compilation

      Please see this article for troubleshooting help:

      http://devcenter.heroku.com/articles/rails31_heroku_cedar#troubleshooting

然后更好地查看heroku日志,我也看到了这个:

psych/syntax_error.rb:5:in 'initialize': wrong number of arguments (1 for 6) (ArgumentError)

谷歌搜索结果是something similar,我试过了,它有效!

【讨论】:

  • 谢谢!我有一个类似的问题,阻止它安装“bins and native extensions”,这也没有阻止它以同样的方式部署和破坏。
【解决方案2】:

2012-07-25T22:11:29+00:00 app[web.1]:您的 Ruby 版本是 1.9.2,但您的 Gemfile 指定的是 1.9.3

https://devcenter.heroku.com/articles/ruby-versions

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-04-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-10
    • 2020-08-07
    相关资源
    最近更新 更多