我有一个问题,我不知道如何解决......你能帮帮我吗?
当我在Heroku上启动我的应用程序时,我收到错误消息:
应用程序中发生错误,您的页面无法执行 提供服务。请稍后再试。
如果您是应用程序所有者,请查看日志以获取详细信息。
我的日志说:
2013-11-12T11:57:32.339883+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=rafpintereststyle.herokuapp.com fwd="81.57.5.203" dyno= connect= service= status=503 bytes=
2013-11-12T11:57:32.960681+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=rafpintereststyle.herokuapp.com fwd="81.57.5.203" dyno= connect= service= status=503 bytes=
我不知道该怎么做..你能帮助我吗?
以下是整个日志:
MacBook-de-Raphael:pinterest raphaelbendenoun$ heroku logs 2013-11-12T15:53:06.935203+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:590:in `each' 2013-11-12T15:53:06.935637+00:00 app[web.1]: from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component' 2013-11-12T15:53:06.935637+00:00 app[web.1]: from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:203:in `each_strongly_connected_component_from' 2013-11-12T15:53:06.935637+00:00 app[web.1]: from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:180:in `each' 2013-11-12T15:53:06.935871+00:00 app[web.1]: from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component' 2013-11-12T15:53:06.936785+00:00 app[web.1]: from /app/config.ru:in `' 2013-11-12T15:53:06.935871+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require' 2013-11-12T15:53:06.935871+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require' 2013-11-12T15:53:06.936785+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file' 2013-11-12T15:53:06.936785+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval' 2013-11-12T15:53:06.936785+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string' 2013-11-12T15:53:06.935203+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `run' 2013-11-12T15:53:06.937220+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:78:in `block in ' 2013-11-12T15:53:06.935871+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in `method_missing' 2013-11-12T15:53:06.935637+00:00 app[web.1]: from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:209:in `block in each_strongly_connected_component_from' 2013-11-12T15:53:06.935637+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:44:in `each' 2013-11-12T15:53:06.935871+00:00 app[web.1]: from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each' 2013-11-12T15:53:06.953279+00:00 app[web.1]: => Booting WEBrick 2013-11-12T15:53:06.937220+00:00 app[web.1]: from bin/rails:4:in `require' 2013-11-12T15:53:06.937220+00:00 app[web.1]: from bin/rails:4:in `' 2013-11-12T15:53:06.953279+00:00 app[web.1]: => Rails 4.0.0 application starting in production on http://0.0.0.0:30103 2013-11-12T15:53:06.953279+00:00 app[web.1]: => Run `rails server -h` for more startup options 2013-11-12T15:53:06.953279+00:00 app[web.1]: => Ctrl-C to shutdown server 2013-11-12T15:53:06.935637+00:00 app[web.1]: from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component' 2013-11-12T15:53:06.935871+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency' 2013-11-12T15:53:06.935871+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require' 2013-11-12T15:53:06.936785+00:00 app[web.1]: from /app/config.ru:3:in `block in ' 2013-11-12T15:53:06.935871+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:54:in `run_initializers' 2013-11-12T15:53:06.935871+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:215:in `initialize!' 2013-11-12T15:53:06.936785+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config' 2013-11-12T15:53:06.936785+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:199:in `app' 2013-11-12T15:53:06.937220+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/commands/server.rb:48:in `app' 2013-11-12T15:53:06.936785+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize' 2013-11-12T15:53:06.936785+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval' 2013-11-12T15:53:06.936785+00:00 app[web.1]: from /app/config.ru:in `new' 2013-11-12T15:53:06.937220+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/commands/server.rb:75:in `start' 2013-11-12T15:53:06.937220+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:73:in `tap' 2013-11-12T15:53:06.937220+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:73:in `' 2013-11-12T15:53:06.937220+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app' 2013-11-12T15:53:06.953279+00:00 app[web.1]: Exiting 2013-11-12T15:53:08.596905+00:00 heroku[web.1]: State changed from starting to crashed 2013-11-12T15:53:08.596905+00:00 heroku[web.1]: State changed from crashed to starting 2013-11-12T15:53:08.581502+00:00 heroku[web.1]: Process exited with status 1 2013-11-12T15:53:14.903202+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 16552 -e $RAILS_ENV` 2013-11-12T15:53:19.840518+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require': /app/config/environments/production.rb:89: syntax error, unexpected tSTRING_DEND, expecting keyword_end (SyntaxError) 2013-11-12T15:53:19.840518+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require' 2013-11-12T15:53:19.840518+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require' 2013-11-12T15:53:19.840518+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency' 2013-11-12T15:53:19.840518+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:591:in `block (2 levels) in ' 2013-11-12T15:53:19.840518+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:590:in `block in ' 2013-11-12T15:53:19.840518+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `instance_exec' 2013-11-12T15:53:19.840518+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:590:in `each' 2013-11-12T15:53:19.840518+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:55:in `block in run_initializers' 2013-11-12T15:53:19.840697+00:00 app[web.1]: from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each' 2013-11-12T15:53:19.840518+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `run' 2013-11-12T15:53:19.840697+00:00 app[web.1]: from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component' 2013-11-12T15:53:19.840697+00:00 app[web.1]: from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:210:in `block (2 levels) in each_strongly_connected_component_from' 2013-11-12T15:53:19.840697+00:00 app[web.1]: from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from' 2013-11-12T15:53:19.840697+00:00 app[web.1]: from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:209:in `block in each_strongly_connected_component_from' 2013-11-12T15:53:19.840697+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:44:in `tsort_each_child' 2013-11-12T15:53:19.840697+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:44:in `each' 2013-11-12T15:53:19.840697+00:00 app[web.1]: from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:203:in `each_strongly_connected_component_from' 2013-11-12T15:53:19.840697+00:00 app[web.1]: from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:180:in `each' 2013-11-12T15:53:19.840697+00:00 app[web.1]: from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component' 2013-11-12T15:53:19.840854+00:00 app[web.1]: from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component' 2013-11-12T15:53:19.840854+00:00 app[web.1]: from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each' 2013-11-12T15:53:19.840854+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:54:in `run_initializers' 2013-11-12T15:53:19.840854+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in `method_missing' 2013-11-12T15:53:19.840854+00:00 app[web.1]: from /app/config/environment.rb:5:in `' 2013-11-12T15:53:19.840854+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require' 2013-11-12T15:53:19.840854+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:215:in `initialize!' 2013-11-12T15:53:19.840854+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require' 2013-11-12T15:53:19.840854+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency' 2013-11-12T15:53:19.841281+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval' 2013-11-12T15:53:19.840854+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require' 2013-11-12T15:53:19.841281+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize' 2013-11-12T15:53:19.841281+00:00 app[web.1]: from /app/config.ru:3:in `block in ' 2013-11-12T15:53:19.841281+00:00 app[web.1]: from /app/config.ru:in `new' 2013-11-12T15:53:19.841281+00:00 app[web.1]: from /app/config.ru:in `' 2013-11-12T15:53:19.841281+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval' 2013-11-12T15:53:19.841281+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string' 2013-11-12T15:53:19.841281+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file' 2013-11-12T15:53:19.841281+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config' 2013-11-12T15:53:19.841281+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:199:in `app' 2013-11-12T15:53:19.841443+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/commands/server.rb:75:in `start' 2013-11-12T15:53:19.841443+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:78:in `block in ' 2013-11-12T15:53:19.841443+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:73:in `' 2013-11-12T15:53:19.841443+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/commands/server.rb:48:in `app' 2013-11-12T15:53:19.841443+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app' 2013-11-12T15:53:19.841443+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:73:in `tap' 2013-11-12T15:53:19.841443+00:00 app[web.1]: from bin/rails:4:in `' 2013-11-12T15:53:19.841443+00:00 app[web.1]: from bin/rails:4:in `require' 2013-11-12T15:53:19.875241+00:00 app[web.1]: => Booting WEBrick 2013-11-12T15:53:19.875241+00:00 app[web.1]: => Run `rails server -h` for more startup options 2013-11-12T15:53:19.875241+00:00 app[web.1]: Exiting 2013-11-12T15:53:19.875241+00:00 app[web.1]: => Rails 4.0.0 application starting in production on http://0.0.0.0:16552 2013-11-12T15:53:19.875241+00:00 app[web.1]: => Ctrl-C to shutdown server 2013-11-12T15:53:21.173163+00:00 heroku[web.1]: Process exited with status 1 2013-11-12T15:53:21.974388+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=rafpintereststyle.herokuapp.com fwd="81.57.5.203" dyno= connect= service= status=503 bytes= 2013-11-12T15:53:22.690618+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=rafpintereststyle.herokuapp.com fwd="81.57.5.203" dyno= connect= service= status=503 bytes= 2013-11-12T15:53:21.185526+00:00 heroku[web.1]: State changed from starting to crashed
我的production.rb文件:
Pinterest::Application.configure do # Settings specified here will take precedence over those in config/application.rb. # Code is not reloaded between requests. config.cache_classes = true # Eager load code on boot. This eager loads most of Rails and # your application in memory, allowing both thread web servers # and those relying on copy on write to perform better. # Rake tasks automatically ignore this option for performance. config.eager_load = true # Full error reports are disabled and caching is turned on. config.consider_all_requests_local = false config.action_controller.perform_caching = true # Enable Rack::Cache to put a simple HTTP cache in front of your application # Add `rack-cache` to your Gemfile before enabling this. # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid. # config.action_dispatch.rack_cache = true # Disable Rails's static asset server (Apache or nginx will already do this). config.serve_static_assets = false # Compress JavaScripts and CSS. config.assets.js_compressor = :uglifier # config.assets.css_compressor = :sass # Do not fallback to assets pipeline if a precompiled asset is missed. config.assets.compile = false # Generate digests for assets URLs. config.assets.digest = true # Version of your assets, change this if you want to expire all your assets. config.assets.version = '1.0' # Specifies the header that your server uses for sending files. # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. # config.force_ssl = true # Set to :debug to see everything in the log. config.log_level = :debug # Prepend all log lines with the following tags. # config.log_tags = [ :subdomain, :uuid ] # Use a different logger for distributed setups. # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) # Use a different cache store in production. # config.cache_store = :mem_cache_store # Enable serving of images, stylesheets, and JavaScripts from an asset server. # config.action_controller.asset_host = "http://assets.example.com" # Precompile additional assets. # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. # config.assets.precompile += %w( search.js ) # Ignore bad email addresses and do not raise email delivery errors. # Set this to true and configure the email server for immediate delivery to raise delivery errors. # config.action_mailer.raise_delivery_errors = false # Enable locale fallbacks for I18n (makes lookups for any locale fall back to # the I18n.default_locale when a translation can not be found). config.i18n.fallbacks = true # Send deprecation notices to registered listeners. config.active_support.deprecation = :notify # Disable automatic flushing of the log to improve performance. # config.autoflush_log = false # Use default logging formatter so that PID and timestamp are not suppressed. config.log_formatter = ::Logger::Formatter.new config.action_mailer.default_url_options = { :host => 'http://http://rafpintereststyle.herokuapp.com/' } #paperclip to amazon #config.paperclip_defaults = { #:storage => :s3, #:s3_credentials => { # :bucket => ENV['AWS_BUCKET'], #:access_key_id => ENV['AWS_ACCESS_KEY_ID'], #:secret_access_key => ENV['AWS_SECRET_ACCESS_KEY'] } } end
答案 0 :(得分:1)
您的production.rb 文件中存在语法错误!(根据您发布的日志)
注意最后两行是关闭哈希括号。
它们应该被注释掉,因为开头标记已被注释掉。
Pinterest::Application.configure do
# ...
# BUNCH OF OTHER SETTINGS
# ...
#paperclip to amazon
#config.paperclip_defaults = {
#:storage => :s3,
#:s3_credentials => {
# :bucket => ENV['AWS_BUCKET'],
#:access_key_id => ENV['AWS_ACCESS_KEY_ID'],
#:secret_access_key => ENV['AWS_SECRET_ACCESS_KEY']
#} YOUR FILE NEEDS TO COMMENT THIS OUT
#} YOUR FILE NEEDS TO COMMENT THIS OUT
end