Reputation: 19
I get the following error when trying to access my app on heroku. The app was deployed successfully but I could not access it. When I tried to access the app, the page said "Application error An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details." Here is the heroku logs:
heroku logs
2017-03-21T20:28:21.577989+00:00 app[web.1]: from /app/config.ru:in `<main>'
2017-03-21T20:28:21.578004+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/rack-2.0.1/lib/rack/builder.rb:49:in `eval'
2017-03-21T20:28:21.578005+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/rack-2.0.1/lib/rack/builder.rb:49:in `new_from_string'
2017-03-21T20:28:21.578007+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/rack-2.0.1/lib/rack/builder.rb:40:in `parse_file'
2017-03-21T20:28:21.578008+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/rack-2.0.1/lib/rack/server.rb:318:in `build_app_and_options_from_config'
2017-03-21T20:28:21.578010+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/rack-2.0.1/lib/rack/server.rb:218:in `app'
2017-03-21T20:28:21.749663+00:00 heroku[web.1]: Process exited with status 1
2017-03-21T20:28:21.578012+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/railties-5.0.2/lib/rails/commands/server.rb:59:in `app'
2017-03-21T20:28:21.578026+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/rack-2.0.1/lib/rack/server.rb:353:in `wrapped_app'
2017-03-21T20:28:21.578029+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/rack-2.0.1/lib/rack/server.rb:282:in `start'
2017-03-21T20:28:21.578030+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/railties-5.0.2/lib/rails/commands/server.rb:79:in `start'
2017-03-21T20:28:21.578032+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:90:in `block in serv er'
2017-03-21T20:28:21.578033+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:85:in `tap'
2017-03-21T20:28:21.578035+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:85:in `server'
2017-03-21T20:28:21.578037+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
2017-03-21T20:28:21.578052+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/railties-5.0.2/lib/rails/commands.rb:18:in `<top (required)>'
2017-03-21T20:28:21.578078+00:00 app[web.1]: from bin/rails:4:in `require'
2017-03-21T20:28:21.578079+00:00 app[web.1]: from bin/rails:4:in `<main>'
2017-03-21T20:28:21.768673+00:00 heroku[web.1]: State changed from starting to c rashed
2017-03-21T20:28:23.139347+00:00 heroku[router]: at=error code=H10 desc="App cra shed" method=GET path="/recipes" host=weather-consult.herokuapp.com request_id=9 801a23f-72b9-4477-8e90-93fba979e78f fwd="83.138.193.223" dyno= connect= service= status=503 bytes= protocol=https
2017-03-21T20:28:23.718785+00:00 heroku[router]: at=error code=H10 desc="App cra shed" method=GET path="/favicon.ico" host=weather-consult.herokuapp.com request_ id=100c960d-b3a1-4374-ae56-52e60b785710 fwd="83.138.193.223" dyno= connect= serv ice= status=503 bytes= protocol=https
2017-03-21T20:28:40.702732+00:00 heroku[web.1]: State changed from crashed to st arting
2017-03-21T20:28:43.480189+00:00 heroku[web.1]: Starting process with command `b in/rails server -p 41364 -e production`
2017-03-21T20:28:48.023383+00:00 app[web.1]: => Rails 5.0.2 application starting in production on http://0.0.0.0:41364
2017-03-21T20:28:48.023384+00:00 app[web.1]: => Run `rails server -h` for more s tartup options
2017-03-21T20:28:48.023369+00:00 app[web.1]: => Booting Puma
2017-03-21T20:28:48.023384+00:00 app[web.1]: Exiting
2017-03-21T20:28:48.023457+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/ activerecord-5.0.2/lib/active_record/connection_adapters/connection_specificatio n.rb:176:in `rescue in spec': Specified 'postgresql' for database adapter, but t he gem is not loaded. Add `gem 'pg'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord). (Gem::LoadError)
2017-03-21T20:28:48.023485+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/activerecord-5.0.2/lib/active_record/connection_adapters/connection_spec ification.rb:173:in `spec'
2017-03-21T20:28:48.023486+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/activerecord-5.0.2/lib/active_record/connection_handling.rb:53:in `estab lish_connection'
2017-03-21T20:28:48.023487+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/activerecord-5.0.2/lib/active_record/railtie.rb:125:in `block (2 levels) in <class:Railtie>'
2017-03-21T20:28:48.023531+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/activesupport-5.0.2/lib/active_support/lazy_load_hooks.rb:49:in `each'
2017-03-21T20:28:48.023532+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/activesupport-5.0.2/lib/active_support/lazy_load_hooks.rb:49:in `run_loa d_hooks'
2017-03-21T20:28:48.023526+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/activesupport-5.0.2/lib/active_support/lazy_load_hooks.rb:43:in `instanc e_eval'
2017-03-21T20:28:48.023527+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/activesupport-5.0.2/lib/active_support/lazy_load_hooks.rb:43:in `execute _hook'
2017-03-21T20:28:48.023534+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/activerecord-5.0.2/lib/active_record/base.rb:324:in `<module:ActiveRecor d>'
2017-03-21T20:28:48.023528+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/activesupport-5.0.2/lib/active_support/lazy_load_hooks.rb:50:in `block i n run_load_hooks'
2017-03-21T20:28:48.023535+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/activerecord-5.0.2/lib/active_record/base.rb:24:in `<top (required)>'
2017-03-21T20:28:48.023537+00:00 app[web.1]: from /app/app/models/application _record.rb:1:in `<top (required)>'
2017-03-21T20:28:48.023539+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:293:in `require'
2017-03-21T20:28:48.023569+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:37:in `block in l oad_interlock'
2017-03-21T20:28:48.023564+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:293:in `block in require'
2017-03-21T20:28:48.023590+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/activesupport-5.0.2/lib/active_support/dependencies/interlock.rb:12:in ` block in loading'
2017-03-21T20:28:48.023565+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:259:in `load_depe ndency'
2017-03-21T20:28:48.023590+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/activesupport-5.0.2/lib/active_support/concurrency/share_lock.rb:150:in `exclusive'
2017-03-21T20:28:48.023566+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:293:in `require'
2017-03-21T20:28:48.023568+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:380:in `block in require_or_load'
2017-03-21T20:28:48.023591+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/activesupport-5.0.2/lib/active_support/dependencies/interlock.rb:11:in ` loading'
2017-03-21T20:28:48.023592+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:37:in `load_inter lock'
2017-03-21T20:28:48.023593+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:358:in `require_o r_load'
2017-03-21T20:28:48.023599+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/railties-5.0.2/lib/rails/engine.rb:473:in `each'
2017-03-21T20:28:48.023598+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/railties-5.0.2/lib/rails/engine.rb:475:in `block in eager_load!'
2017-03-21T20:28:48.023600+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/railties-5.0.2/lib/rails/engine.rb:473:in `eager_load!'
2017-03-21T20:28:48.023594+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:336:in `depend_on '
2017-03-21T20:28:48.023594+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:252:in `require_d ependency'
2017-03-21T20:28:48.023597+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/railties-5.0.2/lib/rails/engine.rb:475:in `each'
2017-03-21T20:28:48.023595+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/railties-5.0.2/lib/rails/engine.rb:476:in `block (2 levels) in eager_loa d!'
2017-03-21T20:28:48.023602+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/railties-5.0.2/lib/rails/engine.rb:354:in `eager_load!'
2017-03-21T20:28:48.023603+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/railties-5.0.2/lib/rails/application/finisher.rb:59:in `each'
2017-03-21T20:28:48.023605+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/railties-5.0.2/lib/rails/application/finisher.rb:59:in `block in <module :Finisher>'
2017-03-21T20:28:48.023606+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/railties-5.0.2/lib/rails/initializable.rb:30:in `instance_exec'
2017-03-21T20:28:48.023626+00:00 app[web.1]: from /app/vendor/ruby-2.2.6/lib/ ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_componen t'
2017-03-21T20:28:48.023608+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/railties-5.0.2/lib/rails/initializable.rb:30:in `run'
2017-03-21T20:28:48.023628+00:00 app[web.1]: from /app/vendor/ruby-2.2.6/lib/ ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
2017-03-21T20:28:48.023639+00:00 app[web.1]: from /app/vendor/ruby-2.2.6/lib/ ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
2017-03-21T20:28:48.023610+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/railties-5.0.2/lib/rails/initializable.rb:55:in `block in run_initialize rs'
2017-03-21T20:28:48.023612+00:00 app[web.1]: from /app/vendor/ruby-2.2.6/lib/ ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
2017-03-21T20:28:48.023641+00:00 app[web.1]: from /app/vendor/ruby-2.2.6/lib/ ruby/2.2.0/tsort.rb:345:in `each'
2017-03-21T20:28:48.023643+00:00 app[web.1]: from /app/vendor/ruby-2.2.6/lib/ ruby/2.2.0/tsort.rb:345:in `call'
2017-03-21T20:28:48.023649+00:00 app[web.1]: from /app/vendor/ruby-2.2.6/lib/ ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
2017-03-21T20:28:48.023663+00:00 app[web.1]: from /app/config/environment.rb: 5:in `<top (required)>'
2017-03-21T20:28:48.023651+00:00 app[web.1]: from /app/vendor/ruby-2.2.6/lib/ ruby/2.2.0/tsort.rb:224:in `tsort_each'
2017-03-21T20:28:48.023653+00:00 app[web.1]: from /app/vendor/ruby-2.2.6/lib/ ruby/2.2.0/tsort.rb:203:in `tsort_each'
2017-03-21T20:28:48.023665+00:00 app[web.1]: from /app/config.ru:3:in `requir e_relative'
2017-03-21T20:28:48.023655+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/railties-5.0.2/lib/rails/initializable.rb:54:in `run_initializers'
2017-03-21T20:28:48.023671+00:00 app[web.1]: from /app/config.ru:3:in `block in <main>'
2017-03-21T20:28:48.023661+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/railties-5.0.2/lib/rails/application.rb:352:in `initialize!'
2017-03-21T20:28:48.023673+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/rack-2.0.1/lib/rack/builder.rb:55:in `instance_eval'
2017-03-21T20:28:48.023675+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/rack-2.0.1/lib/rack/builder.rb:55:in `initialize'
2017-03-21T20:28:48.023678+00:00 app[web.1]: from /app/config.ru:in `new'
2017-03-21T20:28:48.023683+00:00 app[web.1]: from /app/config.ru:in `<main>'
2017-03-21T20:28:48.023696+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/rack-2.0.1/lib/rack/server.rb:318:in `build_app_and_options_from_config'
2017-03-21T20:28:48.023697+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/rack-2.0.1/lib/rack/server.rb:218:in `app'
2017-03-21T20:28:48.023685+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/rack-2.0.1/lib/rack/builder.rb:49:in `eval'
2017-03-21T20:28:48.023700+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/railties-5.0.2/lib/rails/commands/server.rb:59:in `app'
2017-03-21T20:28:48.023687+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/rack-2.0.1/lib/rack/builder.rb:49:in `new_from_string'
2017-03-21T20:28:48.023690+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/rack-2.0.1/lib/rack/builder.rb:40:in `parse_file'
2017-03-21T20:28:48.023702+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/rack-2.0.1/lib/rack/server.rb:353:in `wrapped_app'
2017-03-21T20:28:48.023704+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/rack-2.0.1/lib/rack/server.rb:282:in `start'
2017-03-21T20:28:48.023710+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/railties-5.0.2/lib/rails/commands/server.rb:79:in `start'
2017-03-21T20:28:48.023712+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:90:in `block in serv er'
2017-03-21T20:28:48.023714+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:85:in `tap'
2017-03-21T20:28:48.023715+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:85:in `server'
2017-03-21T20:28:48.023724+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/railties-5.0.2/lib/rails/commands.rb:18:in `<top (required)>'
2017-03-21T20:28:48.023718+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2 .0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
2017-03-21T20:28:48.023726+00:00 app[web.1]: from bin/rails:4:in `require'
2017-03-21T20:28:48.023732+00:00 app[web.1]: from bin/rails:4:in `<main>'
2017-03-21T20:28:48.114357+00:00 heroku[web.1]: Process exited with status 1
2017-03-21T20:28:48.128920+00:00 heroku[web.1]: State changed from starting to c rashed
2017-03-21T20:28:49.680428+00:00 heroku[router]: at=error code=H10 desc="App cra shed" method=GET path="/recipes" host=weather-consult.herokuapp.com request_id=a 42f1683-8c92-412e-bc36-35bee47fd044 fwd="83.138.193.223" dyno= connect= service= status=503 bytes= protocol=https
2017-03-21T20:28:50.139167+00:00 heroku[router]: at=error code=H10 desc="App cra shed" method=GET path="/favicon.ico" host=weather-consult.herokuapp.com request_ id=70b71bcf-af11-489f-bdee-f3325249f7fe fwd="83.138.193.223" dyno= connect= serv ice= status=503 bytes= protocol=https
Upvotes: 0
Views: 282
Reputation: 1439
You must not have pg in your Gemfile which makes me think that you might be missing deployment specific stuff from your gemfile. Find the sqlite3
or equivalent development database gem and restructure it like this in your gemfile, which is typically how its done. Heroku automagically looks for that :production environment and loads the applicable configs for that.
group :development do
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
gem 'web-console', '>= 3.3.0'
gem 'sqlite3'
end
group :production do
gem 'pg'
gem 'rails_12factor'
gem 'letsencrypt-rails-heroku'
end
You also sometimes get that error when you forget to migrate the database when your schema changes. You can do that with heroku run rake db:migrate
.
Upvotes: 1
Reputation: 1873
You need to update your logs in the question so they are a bit more readable. You need to add pg to your Gemfile as you are using Postgresql.
The gem is not loaded. Add `gem 'pg'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).(Gem::LoadError)
Upvotes: 0
Reputation: 69
Try to restart dynos.
heroku ps:restart
or try simply heroku restart
Description: Devcenter Heroku
This also can by helpful Heroku deployment error H10 (App crashed)
Upvotes: 0