7
votes

I have an issue that I do not know how to solve ... Could you help me please ?

When I launch my app on Heroku I get the error message:

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.

and my logs say:

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=

I have no idea what to do .. could you help me?

Here is the entire logs:

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

My production.rb file :


    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

1
Would you please change the logging level in config/environments/production.rb to :debug and run this again so we can get a more detailed log file?CDub
Hello CDub thx for answering I changed it and here is what i got ..Ben2pop
Did you stop all dynos? If so, start one with heroku ps:scale web=1.zwippie
Hey, Yes I tried it and the console said :Scaling web dynos... done, now running 1 but it did not help ... ;-(Ben2pop
There's something blowing up on /app/config/environments/production.rb:89 - check line 89 of that file.CDub

1 Answers

1
votes

You have a syntax error in your production.rb file!(According to the logs you posted)

Notices the last 2 lines are closing hash brackets.

they should be commented out because the opening tags are commented out.

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