简体   繁体   English

Rails + Heroku:我们很抱歉,但出了点问题

[英]Rails + Heroku : We're sorry, but something went wrong

Hi this is my first time trying to push a project up to Heroku and I am getting the error: We're sorry, but something went wrong. 嗨,这是我第一次尝试将项目推送到Heroku,我收到错误: We're sorry, but something went wrong. I'm not sure how to read the heroku log. 我不知道如何阅读heroku日志。 Is it the deprecation warnings? 这是弃用警告吗? I don't have anything in my vendor/plugins... Can someone help me figure out what's wrong? 我的供应商/插件中没有任何东西......有人可以帮我弄清楚出了什么问题吗? Let me know if you need any other files. 如果您需要任何其他文件,请告诉我。

2012-10-23T20:29:56+00:00 app[web.1]:   Rendered home/index.html.erb within layouts/application (10.8ms)
2012-10-23T20:29:56+00:00 app[web.1]: WARN: tilt autoloading 'sass' in a non thread-safe way; explicit require 'sass' suggested.
2012-10-23T20:29:56+00:00 app[web.1]:     2: <html>
2012-10-23T20:29:56+00:00 app[web.1]:     3: <head>
2012-10-23T20:29:56+00:00 app[web.1]:     4:   <title><%= complete_title(yield(:title)) %></title>
2012-10-23T20:29:56+00:00 app[web.1]: ActionView::Template::Error (/app/app/assets/stylesheets/application.css has already been required):
2012-10-23T20:29:56+00:00 app[web.1]:     8: </head>
2012-10-23T20:29:56+00:00 app[web.1]:     5:   <%= stylesheet_link_tag    "application", :media => "all" %>
2012-10-23T20:29:56+00:00 app[web.1]:     6:   <%= javascript_include_tag "application" %>
2012-10-23T20:29:56+00:00 app[web.1]:     7:   <%= csrf_meta_tags %>
2012-10-23T20:29:56+00:00 app[web.1]:   app/views/layouts/application.html.erb:5:in `_app_views_layouts_application_html_erb___2170089293047453939_42303620'
2012-10-23T20:29:56+00:00 app[web.1]: 
2012-10-23T20:29:56+00:00 app[web.1]: 
2012-10-23T20:29:56+00:00 app[web.1]: 
2012-10-23T20:29:56+00:00 app[web.1]: Completed 500 Internal Server Error in 664ms
2012-10-23T20:29:56+00:00 heroku[router]: GET pacific-ravine-3563.herokuapp.com/ dyno=web.1 queue=0 wait=0ms service=806ms status=500 bytes=643
2012-10-23T20:29:56+00:00 heroku[router]: GET pacific-ravine-3563.herokuapp.com/favicon.ico dyno=web.1 queue=0 wait=0ms service=11ms status=200 bytes=0
2012-10-23T20:30:32+00:00 app[web.1]: 
2012-10-23T20:30:32+00:00 app[web.1]: Started GET "/" for 66.108.172.226 at 2012-10-23 20:30:32 +0000
2012-10-23T20:30:32+00:00 app[web.1]: 
2012-10-23T20:30:32+00:00 app[web.1]: Processing by HomeController#index as HTML
2012-10-23T20:30:32+00:00 app[web.1]:   Rendered home/index.html.erb within layouts/application (0.4ms)
2012-10-23T20:30:32+00:00 app[web.1]: ActionView::Template::Error (/app/app/assets/stylesheets/application.css has already been required):
2012-10-23T20:30:32+00:00 app[web.1]:     2: <html>
2012-10-23T20:30:32+00:00 app[web.1]:     3: <head>
2012-10-23T20:30:32+00:00 app[web.1]:     4:   <title><%= complete_title(yield(:title)) %></title>
2012-10-23T20:30:32+00:00 app[web.1]:     5:   <%= stylesheet_link_tag    "application", :media => "all" %>
2012-10-23T20:30:32+00:00 app[web.1]:     6:   <%= javascript_include_tag "application" %>
2012-10-23T20:30:32+00:00 app[web.1]: Completed 500 Internal Server Error in 26ms
2012-10-23T20:30:32+00:00 app[web.1]: 
2012-10-23T20:30:32+00:00 app[web.1]:   app/views/layouts/application.html.erb:5:in `_app_views_layouts_application_html_erb___2170089293047453939_42303620'
2012-10-23T20:30:32+00:00 app[web.1]: 
2012-10-23T20:30:32+00:00 app[web.1]: 
2012-10-23T20:30:32+00:00 app[web.1]:     7:   <%= csrf_meta_tags %>
2012-10-23T20:30:32+00:00 app[web.1]:     8: </head>
2012-10-23T20:30:32+00:00 heroku[router]: GET pacific-ravine-3563.herokuapp.com/ dyno=web.1 queue=0 wait=0ms service=47ms status=500 bytes=643
2012-10-23T21:35:53+00:00 heroku[web.1]: Idling
2012-10-23T21:35:56+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2012-10-23T21:35:57+00:00 app[web.1]:   /usr/local/lib/ruby/1.9.1/webrick/server.rb:90:in `select'
2012-10-23T21:35:57+00:00 app[web.1]: [2012-10-23 21:35:57] ERROR SignalException: SIGTERM
2012-10-23T21:36:06+00:00 heroku[web.1]: Stopping remaining processes with SIGKILL
2012-10-23T21:36:06+00:00 heroku[web.1]: Error R12 (Exit timeout) -> At least one process failed to exit within 10 seconds of SIGTERM
2012-10-23T21:36:08+00:00 heroku[web.1]: Process exited with status 137
2012-10-23T21:36:12+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 45563`
2012-10-23T21:36:17+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)
2012-10-23T21:36:17+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 note
s 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)
2012-10-23T21:36:17+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)
2012-10-23T21:36:21+00:00 app[web.1]: => Ctrl-C to shutdown server
2012-10-23T21:36:21+00:00 app[web.1]: Connecting to database specified by DATABASE_URL
2012-10-23T21:36:21+00:00 app[web.1]: => Booting WEBrick
2012-10-23T21:36:21+00:00 app[web.1]: => Rails 3.2.8 application starting in production on http://0.0.0.0:45563
2012-10-23T21:36:21+00:00 app[web.1]: => Call with -d to detach
2012-10-23T21:36:22+00:00 app[web.1]: [2012-10-23 21:36:22] INFO  WEBrick 1.3.1
2012-10-23T21:36:22+00:00 app[web.1]: [2012-10-23 21:36:22] INFO  ruby 1.9.2 (2011-07-09) [x86_64-linux]
2012-10-23T21:36:22+00:00 app[web.1]: [2012-10-23 21:36:22] INFO  WEBrick::HTTPServer#start: pid=2 port=45563
2012-10-23T21:36:23+00:00 heroku[web.1]: State changed from starting to up
2012-10-23T22:39:55+00:00 heroku[web.1]: Idling
2012-10-23T2
2:39:59+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2012-10-23T22:39:59+00:00 app[web.1]: [2012-10-23 22:39:59] ERROR SignalException: SIGTERM
2012-10-23T22:39:59+00:00 app[web.1]:   /usr/local/lib/ruby/1.9.1/webrick/server.rb:90:in `select'
2012-10-23T22:40:08+00:00 heroku[web.1]: Error R12 (Exit timeout) -> At least one process failed to exit within 10 seconds of SIGTERM
2012-10-23T22:40:08+00:00 heroku[web.1]: Stopping remaining processes with SIGKILL
2012-10-23T22:40:11+00:00 heroku[web.1]: Process exited with status 137
2012-10-23T22:40:11+00:00 heroku[web.1]: State changed from up to down
2012-10-24T00:05:40+00:00 heroku[web.1]: Unidling
2012-10-24T00:05:40+00:00 heroku[web.1]: State changed from down to starting
2012-10-24T00:05:42+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 26314`
2012-10-24T00:05:46+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)
2012-10-24T00:05:46+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)
2012-10-24T00:05:46+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)
2012-10-24T00:05:50+00:00 app[web.1]: => Booting WEBrick
2012-10-24T00:05:50+00:00 app[web.1]: => Rails 3.2.8 application starting in production on http://0.0.0.0:26314
2012-10-24T00:05:50+00:00 app[web.1]: => Call with -d to detach
2012-10-24T00:05:50+00:00 app[web.1]: => Ctrl-C to shutdown server
2012-10-24T00:05:50+00:00 app[web.1]: Connecting to database specified by DATABASE_URL
2012-10-24T00:05:50+00:00 app[web.1]: [2012-10-24 00:05:50] INFO  WEBrick 1.3.1
2012-10-24T00:05:50+00:00 app[web.1]: [2012-10-24 00:05:50] INFO  WEBrick::HTTPServer#start: pid=2 port=26314
2012-10-24T00:05:50+00:00 app[web.1]: [2012-10-24 00:05:50] INFO  ruby 1.9.2 (2011-07-09) [x86_64-linux]
2012-10-24T00:05:51+00:00 heroku[web.1]: State changed from starting to up
2012-10-24T00:05:52+00:00 heroku[router]: GET pacific-ravine-3563.herokuapp.com/ dyno=web.1 queue=0 wait=0ms service=29ms status=301 bytes=0
2012-10-24T00:05:52+00:00 app[web.1]: 
2012-10-24T00:05:52+00:00 app[web.1]: 
2012-10-24T00:05:52+00:00 app[web.1]: Started GET "/" for 208.185.23.206 at 2012-10-24 00:05:52 +0000
2012-10-24T00:05:52+00:00 app[web.1]: Processing by HomeController#index as HTML
2012-10-24T00:05:53+00:00 app[web.1]: WARN: tilt autoloading 'sass' in a non thread-safe way; explicit require 'sass' suggested.
2012-10-24T00:05:53+00:00 app[web.1]:   Rendered home/index.html.erb within layouts/application (16.5ms)
2012-10-24T00:05:53+00:00 app[web.1]: Completed 500 Internal Server Error in 725ms
2012-10-24T00:05:53+00:00 app[web.1]: 
2012-10-24T00:05:53+00:00 app[web.1]: ActionView::Template::Error (/app/app/assets/stylesheets/application.css has already been required):
2012-10-24T00:05:53+00:00 app[web.1]:     2: <html>
2012-10-24T00:05:53+00:00 app[web.1]:     3: <head>
2012-10-24T00:05:53+00:00 app[web.1]:     4:   <title><%= complete_title(yield(:title)) %></title>
2012-10-24T00:05:53+00:00 app[web.1]:     5:   <%= stylesheet_link_tag    "application", :media => "all" %>
2012-10-24T00:05:53+00:00 app[web.1]:     6:   <%= javascript_include_tag "application" %>
2012-10-24T00:05:5
3+00:00 app[web.1]:     7:   <%= csrf_meta_tags %>
2012-10-24T00:05:53+00:00 app[web.1]:     8: </head>
2012-10-24T00:05:53+00:00 app[web.1]:   app/views/layouts/application.html.erb:5:in `_app_views_layouts_application_html_erb___2799874165581384053_34182960'
2012-10-24T00:05:53+00:00 app[web.1]: 
2012-10-24T00:05:53+00:00 app[web.1]: 
2012-10-24T00:05:53+00:00 heroku[router]: GET pacific-ravine-3563.herokuapp.com/ dyno=web.1 queue=0 wait=0ms service=1169ms status=500 bytes=643
2012-10-24T00:05:53+00:00 heroku[router]: GET pacific-ravine-3563.herokuapp.com/favicon.ico dyno=web.1 queue=0 wait=0ms service=10ms status=200 bytes=0

Gemfile 的Gemfile

source 'https://rubygems.org'

gem 'rails', '3.2.8'
gem "bcrypt-ruby"
gem 'paperclip'
gem 'jquery-rails'
gem 'fancybox-rails'
gem 'will_paginate', '~> 3.0'
gem 's3_direct_upload'
gem 'aws-s3'
gem 'aws-sdk'
gem 'mail'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

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

group :production do
  gem 'pg'
end

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platforms => :ruby

  gem 'uglifier', '>= 1.0.3'
  gem 'jquery-fileupload-rails'
end

gem 'jquery-rails'

First, a couple of pointers. 首先,几个指针。 The message We're sorry, but something went wrong is what Heroku presents to the end user on any error in your application, because you're in production mode. 消息We're sorry, but something went wrong是Heroku在应用程序中出现任何错误时向最终用户提供的内容,因为您处于生产模式。 This is different than what happens in development mode on your local machine, on the theory that you don't want to expose debug stack traces to any user of your application who comes along. 这与您在本地计算机上的开发模式中发生的情况不同,理论上您不希望将调试堆栈跟踪公开给出现的应用程序的任何用户。

The deprecation warning is a red herring; 弃用警告是红鲱鱼; it's about some gems that Heroku injects into every Rails application, to integrate with their log management stuff. 它是关于Heroku注入每个Rails应用程序的一些宝石,与它们的日志管理内容集成。

The really pertinent line in your error log is this one: 错误日志中真正相关的行就是这一行:

2012-10-23T20:29:56+00:00 app[web.1]: ActionView::Template::Error (/app/app/assets/stylesheets/application.css has already been required):

That's an error somewhere in how stylesheets are being handled, maybe in the asset pipeline feature. 在样式表的处理方式中,这可能是一个错误,可能在资产管道功能中。 That's why @evanc3 is asking about how many stylesheets you have. 这就是@ evanc3询问你有多少样式表的原因。 And, I confess, I don't know how to debug this issue - so this is only a partial answer. 而且,我承认,我不知道如何调试这个问题 - 所以这只是一个部分答案。 Hopefully I've gotten you on the right path. 希望我能让你走上正确的道路。

Google with WARN: tilt autoloading 'sass' in a non thread-safe way; explicit require 'sass' suggested. 谷歌与WARN: tilt autoloading 'sass' in a non thread-safe way; explicit require 'sass' suggested. WARN: tilt autoloading 'sass' in a non thread-safe way; explicit require 'sass' suggested.

I found this answer: https://stackoverflow.com/a/12859696/1008230 我找到了这个答案: https//stackoverflow.com/a/12859696/1008230
Looks like the assets need be compile locally. 看起来资产需要在本地编译。

Here's some reference: 这里有一些参考:

For faster asset precompiles, you can partially load your application by setting config.assets.initialize_on_precompile to false in config/application.rb, though in that case templates cannot see application objects or methods. 对于更快的资产预编译,您可以通过在config / application.rb中将config.assets.initialize_on_precompile设置为false来部分加载应用程序,但在这种情况下,模板无法查看应用程序对象或方法。 Heroku requires this to be false. Heroku要求这是假的。

http://guides.rubyonrails.org/asset_pipeline.html#precompiling-assets http://guides.rubyonrails.org/asset_pipeline.html#precompiling-assets

While precompiling assets, in Rails 3.1.1 and up, you can prevent initializing your application and connecting to the database by ensuring that the following line is in your config/application.rb: config.assets.initialize_on_precompile = false 在预编译资产时,在Rails 3.1.1及更高版本中,您可以通过确保config / application.rb中包含以下行来阻止初始化应用程序并连接到数据库: config.assets.initialize_on_precompile = false

https://devcenter.heroku.com/articles/rails3x-asset-pipeline-cedar#troubleshooting https://devcenter.heroku.com/articles/rails3x-asset-pipeline-cedar#troubleshooting

Haven't try it myself, hope that helps. 没有自己尝试,希望有所帮助。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM