将Rails应用程序部署到Heroku时出现App崩溃错误

时间:2010-12-14 06:59:16

标签: ruby-on-rails ruby web-applications crash heroku

我遵循heroku博客上提供的有关部署Rails应用程序的所有指导原则。我的应用程序也成功推送并在我的帐户中创建了一个应用程序。但是当我尝试运行我的网站时,它会给我以下错误:

App crashed
This application is temporarily offline.

If you're the administrator of this app, please check your heroku logs for the
backtrace.

我试图检查日志,这是我得到的

C:\Users\raw\Desktop\html\rohit>heroku logs
Missing the Rails 2.3.8 gem. Please `gem install -v=2.3.8 rails`, update your RAILS_GEM_
VERSION setting in config/environment.rb for the Rails version you do have installed, or
 comment out RAILS_GEM_VERSION to use the latest version installed.

==> dyno-3674485.log (crash) <==
Missing the Rails 2.3.8 gem. Please `gem install -v=2.3.8 rails`, update your RAILS_GEM_
VERSION setting in config/environment.rb for the Rails version you do have installed, or
 comment out RAILS_GEM_VERSION to use the latest version installed.

-----> Rails can't find the expected version.

       Check to ensure you have specified the correct version of Rails in your
       Gemfile or .gems.  See http://docs.heroku.com/gems for details.

       You may also be affected by a gem dependency issue with rack.
       See http://docs.heroku.com/gem-dependency for details.

       Examine the backtrace above this message to debug.

II在我的Rails_App目录中创建了一个.gems文件:

rails -v '2.3.8'
pg
rack -v '1.1.0'
haml -v '3.0.13'
formtastic -v '0.9.8'
authlogic -v '2.1.5'
subdomain-fu -v '0.5.4'
compass -v '0.10.2'
compass-colors -v '0.3.1'
paperclip -v '2.3.3'
activemerchant -v '1.9.0'
icalendar

我该怎么做才能让它发挥作用?

3 个答案:

答案 0 :(得分:2)

Rails 2.3.8与机架1.2.1不兼容你无法定义你.gems就像你有一个“机架上的宝石依赖问题”,如define。

尝试使用rake -v = 1.1.0 ActionPack 2.3.8的依赖关系(http://rubygems.org/gems/actionpack/versions/2.3.8

答案 1 :(得分:0)

我的Heroku应用程序,在bamboo-ree-1.8.7堆栈上运行,(运行heroku info以确定您正在运行的堆栈),我有以下配置:

我的.gems文件的第一行

rails --version 2.3.8

您可能还需要将以下内容添加到config / environment.rb文件

config.gem 'rails', :version => '2.3.8'

您需要对heroku进行另一次git推送才能使这些更改生效。

答案 2 :(得分:0)

我添加了命令来忽略.gems文件中的依赖关系--ignore-depedencies,现在它的工作非常感谢guyz。

问题已经解决。

PS:我将解决方案保留为评论,现在将其作为答案提交。