简体   繁体   English

heroku应用程序崩溃但在本地运行良好

[英]heroku app crashes but works great locally

my app works perfectly fine locally and I see no errors when I type git push heroku master. 我的应用程序在本地运行正常,当我输入git push heroku master时我没有看到任何错误。 However when I type heroku open and visit the url I see: 但是,当我输入heroku open并访问URL时,我看到:

Application Error 应用程序错误

An error occurred in the application and your page could not be served. 应用程序中发生错误,无法提供您的页面。 Please try again in a few moments. 请稍后重试。 If you are the application owner, check your logs for details. 如果您是应用程序所有者,请检查日志以获取详细信息。

In heroku logs I get the following: 在heroku日志中,我得到以下信息:

2013-02-24T08:57:38+00:00 heroku[web.1]: Process exited with status 1
2013-02-24T08:57:38+00:00 heroku[web.1]: State changed from starting to crashed
2013-02-24T08:59:21+00:00 heroku[web.1]: State changed from crashed to starting
2013-02-24T08:59:23+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 15485`
2013-02-24T08:59:30+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5)
2013-02-24T08:59:30+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5)
2013-02-24T08:59:33+00:00 app[web.1]: => Booting WEBrick
2013-02-24T08:59:33+00:00 app[web.1]: => Rails 3.2.11 application starting in production on http://0.0.0.0:15485
2013-02-24T08:59:33+00:00 app[web.1]: => Ctrl-C to shutdown server
2013-02-24T08:59:33+00:00 app[web.1]: Exiting
2013-02-24T08:59:33+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:317:in `rescue in depend_on': No such file to load -- spec_helper (LoadError)
2013-02-24T09:04:16+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=whispering-journey-9991.herokuapp.com fwd="108.46.218.98" dyno= queue= wait= connect= service= status=503 bytes=

there's a load error and some deprecating warnings I havn't managed to fix. 有一个加载错误和一些过时的警告,我没有设法解决。 I just updated to rails 3.2.11 not sure if it's related. 我刚刚更新到Rails 3.2.11,不确定是否相关。

gemfile: gemfile:

source 'https://rubygems.org'

gem 'rails', '3.2.11'
gem 'bootstrap-sass', '2.0.4'
gem 'bcrypt-ruby', '3.0.1'
gem 'faker', '1.0.1'
gem 'will_paginate', '3.0.3'
gem 'bootstrap-will_paginate', '0.0.6'
gem 'jquery-rails', '2.0.2'
gem 'pg', '0.12.2'
gem 'rails_autolink', '~> 1.0.9'
gem 'rinku', '~> 1.5.0', :require => 'rails_rinku'
gem 'auto_html', '1.6.0'
gem 'acts_as_votable', '~> 0.4.0'
gem 'thumbs_up', '~> 0.6.2'


group :development, :test do
  gem 'rspec-rails', '2.11.0'
end

group :development do
  gem 'annotate', '2.5.0'
end

group :assets do
  gem 'sass-rails',   '3.2.5'
  gem 'coffee-rails', '3.2.2'
  gem 'uglifier', '1.2.3'
end

group :test do
  gem 'factory_girl_rails', '4.1.0'
  gem 'capybara', '1.1.2'
  gem 'cucumber-rails', '1.2.1', :require => false
  gem 'database_cleaner', '0.7.0'
end

This is the first time im pushing to heroku on this (new) computer not sure if this contributes to the problem. 这是我第一次在这台(新的)计算机上将邮件推送到heroku,不确定是否会导致此问题。

I also get this error when typing git push heroku: 当输入git push heroku时,我也会收到此错误:

   Running: rake assets:precompile
   rake aborted!
   could not connect to server: Connection refused
   Is the server running on host "127.0.0.1" and accepting
   TCP/IP connections on port 5432?

Now looking into: https://devcenter.heroku.com/articles/rails3x-asset-pipeline-cedar 现在调查: https : //devcenter.heroku.com/articles/rails3x-asset-pipeline-cedar

It looks like you are using the default WEBrick server. 您似乎正在使用默认的WEBrick服务器。 Heroku recommends using the 'thin' server. Heroku建议使用“瘦”服务器。 Try adding something like this in your Gemfile: 尝试在Gemfile中添加以下内容:

gem 'thin', :group => :production

Then run bundle install, commit the files with Git and push again to your heroku app. 然后运行捆绑安装,使用Git提交文件,然后再次推送到您的heroku应用。 If you haven't done so, you'll need to precompile assets by tryping the following in your command line: 如果尚未这样做,则需要通过在命令行中尝试以下操作来预编译资产:

RAILS_ENV=production bundle exec rake assets:precompile

Then, don't forget to run your git commands: 然后,不要忘记运行您的git命令:

git add .
git commit -m "added precompiled assets"
git push heroku master

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Heroku:Rails应用程序可在本地运行,但在Heroku上崩溃 - Heroku: Rails app works locally but crashes on heroku Rails应用程序在本地运行,在Heroku上崩溃 - Rails app works locally, crashes on Heroku 应用程序在本地工作但不在Heroku上工作 - App works locally but not on Heroku 需要帮助剖析 heroku 日志 - 应用程序在本地运行,但始终崩溃/无法使用 heroku 打开 - Need help dissecting heroku logs - app works locally but consistently crashes/won't open with heroku Rails 4-应用程序可在本地运行,但不能在Heroku上运行 - Rails 4 - App works locally, but not on Heroku Rails应用程序可以在本地使用载波在S3上正常运行,在Heroku上崩溃,并显示错误消息“无法自动加载常量” - Rails app works fine with S3 using carrierwave locally, crashes on Heroku with error message 'Unable to autoload constant' Heroku应用程序在启动时立即崩溃,在本地运行良好,尝试了我能想到的一切 - Heroku app crashes immediately upon startup, works fine locally, tried everything I can think of Rails App可在本地运行,但在Heroku上部署时无法运行 - Rails App works locally but not when deployed on Heroku Rails App搜索栏可在本地使用,但不能在Heroku上使用 - Rails App search bar works locally but not on Heroku Rails应用程序在本地运行,但在部署到Heroku时则不行 - Rails app works locally but not when deployed to Heroku
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM