Rails app works locally but not when deployed to Heroku

heroku, heroku-postgres, ruby, ruby-on-rails

Solution

After you have to deployed to heroku, you need to run rake db:migrate before it starts work. Go to the folder you pushed the app from and do a

heroku run rake db:migrate

This should fix the 503 errors you are having.

Problem

my app was working locally. I deployed to heroku and am getting an application error. I cant seem to figure out what is wrong. Posting logs below, does anything stick out? 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. logs heroku logs ``` 2014-07-04T04:40:15.871014+00:00 heroku[web.1]: State changed from starting to crashed 2014-07-04T04:40:16.982435+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=kitchen-ninja.herokuapp.com request_id=aa152804-e6f0-4a2f-9c27- c9fb580272f3 fwd="100.1.249.244" dyno= connect= service= status=503 bytes= 2014-07-04T04:40:17.620440+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=kitchen-ninja.herokuapp.com request_id=a3c43716-35b3-43b5-9426-fb2f3f400c1b fwd="100.1.249.244" dyno= connect= service= status=503 bytes= 2014-07-04T04:40:17.783162+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=kitchen-ninja.herokuapp.com request_id=2a8c63d7-3906-48c7-85de-abe64c2fd247 fwd="100.1.249.244" dyno= connect= service= status=503 bytes= 2014-07-04T04:40:15.860319+00:00 heroku[web.1]: Process exited with status 1 ``` gemfile ``` source 'https://rubygems.org' ruby '2.0.0' gem 'rails', '4.0.2' gem 'pg', '0.15.1' gem 'mail_form', '~> 1.5.0.rc' gem 'less-rails' gem 'therubyracer', '~> 0.12.1' gem 'simple_form' gem 'pony' gem 'sass-rails', '4.0.1' gem 'uglifier', '2.1.1' gem 'coffee-rails', '4.0.1' gem 'jquery-rails', '3.0.4' gem 'jquery-turbolinks' gem 'jbuilder', '1.0.2' gem 'paperclip', '4.1' gem 'devise' group :development do gem 'rspec-rails', '2.13.1' gem 'guard-rspec', '2.5.0' end group :test do end group :doc do gem 'sdoc', '0.3.20', require: false end group :production do gem 'rails_12factor', '0.0.2' end ```

Original source