将 Rails 应用程序部署到 Heroku 时出现 App Crashed 错误
我遵循了 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.
我在我的 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
我能做什么让它发挥作用吗?
I followed all the guidelines given on the heroku blog for deploying a Rails app. I also my app got pushed successfully and created an app in my account. But when I try to run my site it gives me the following error:
App crashed
This application is temporarily offline.
If you're the administrator of this app, please check your heroku logs for the
backtrace.
I tried to check the logs and here's what I got
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 have made a .gems
file in my Rails_App directory:
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
What can I do to get this to work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Rails 2.3.8 与rack 1.2.1 不兼容。您无法像define 那样定义.gems,因为您有“rack 的gem 依赖问题”。
尝试使用 rake -v=1.1.0 ActionPack 2.3.8 的依赖项 ( http:// rubygems.org/gems/actionpack/versions/2.3.8)
Rails 2.3.8 is not compatible with rack 1.2.1 You can't define you .gems like that you have a "gem dependency issue with rack" like define.
Try with rake -v=1.1.0 the dependency of ActionPack 2.3.8 ( http://rubygems.org/gems/actionpack/versions/2.3.8)
我的 Heroku 应用程序,在ebam-ree-1.8.7 堆栈上运行(运行
heroku info
来确定您正在运行的堆栈),我有以下配置:我的 .gems 文件的第一行
您可以还需要将以下内容添加到您的 config/environment.rb 文件中
您将需要再次执行 git Push 到 heroku 才能使这些更改生效。
My Heroku app, running on bamboo-ree-1.8.7 stack, (run
heroku info
to determine what stack you are running), I have the following configuration:first line of my .gems file
You may also need to add the following to your config/environment.rb file
You will need to do another git push to heroku for these changes to take effect.
我添加了忽略 .gems 文件中依赖项的命令 --ignore-depedcies,现在它可以工作了,感谢 Guyz 的宝贵时间。
问题解决了。
PS:我将解决方案保留为评论,现在将其作为答案提交。
I added the command to ignore depedencies in the .gems file as --ignore-depedencies and now it works thanks guyz for your time.
The issue is solved.
PS: I had kept the solution as a comment, now submitting it as an answer.