Solution to Application Error on Heroku

I’ve just completed Chapter 8 of the Hartl Rails Tutorial and wanted to deploy my application onto Heroku.

After running the below code in the Cloud 9 IDE terminal, I kept getting an Application Error page on my Heroku view.

$ bundle exec rake test
$ git push
$ git push heroku
$ heroku run rake db:migrate

Application Error page on Heroku:

Application Error Heroku

After perusing the internet for a solution, I found a YouTube video that explains how to find the errors that could lead to an Application Error. You can view the video here.

On the Application Error page, it says:

If you are the application owner, check your logs for details.

To check your logs, enter this into your terminal:

$ heroku logs --tail

This will be similar to what your logs will look like:

2015-08-11 .. +00:00 heroku[run.8473]: State changed from starting to up
2015-08-11 .. +00:00 heroku[run.8473]: State changed from up to complete
2015-08-11 .. +00:00 heroku[run.8473]: Process exited with status 0
2015-08-11 .. +00:00 heroku[api]: Set maintenance mode off by yourname@email.com
2015-08-11 .. +00:00 heroku[web.1]: Unidling
2015-08-11 .. +00:00 heroku[web.1]: State changed from down to starting
2015-08-11 .. +00:00 heroku[web.1]: Starting process with command `bundle exec puma -C config/puma.rbbu`
2015-08-11 .. +00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/puma-2.11.1/lib/puma/configuration.rb:179:in `read': No such file or directory - config/puma.rbbu (Errno::ENOENT)
2015-08-11 .. +00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/puma-2.11.1/lib/puma/configuration.rb:179:in `_load_from'
2015-08-11 .. +00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/puma-2.11.1/lib/puma/configuration.rb:40:in `load'
2015-08-11 .. +00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/puma-2.11.1/lib/puma/cli.rb:308:in `parse_options'
2015-08-11 .. +00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/puma-2.11.1/bin/puma:10:in `<top (required)>'
2015-08-11 .. +00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/puma-2.11.1/lib/puma/cli.rb:453:in `run'
2015-08-11 .. +00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/bin/puma:23:in `load'
2015-08-11 .. +00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/bin/puma:23:in `<main>'
2015-08-11 .. +00:00 heroku[web.1]: State changed from starting to crashed
2015-08-11 .. +00:00 heroku[web.1]: State changed from crashed to starting
2015-08-11 .. +00:00 heroku[web.1]: Process exited with status 1
2015-08-11 .. +00:00 heroku[web.1]: Starting process with command `bundle exec puma -C config/puma.rbbu`
2015-08-11 .. +00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/puma-2.11.1/lib/puma/configuration.rb:179:in `read': No such file or directory - config/puma.rbbu (Errno::ENOENT)
2015-08-11 .. +00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/puma-2.11.1/lib/puma/configuration.rb:179:in `_load_from'
2015-08-11 .. +00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/puma-2.11.1/lib/puma/configuration.rb:40:in `load'
2015-08-11 .. +00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/puma-2.11.1/lib/puma/cli.rb:308:in `parse_options'
2015-08-11 .. +00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/puma-2.11.1/lib/puma/cli.rb:453:in `run'
2015-08-11 .. +00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/puma-2.11.1/bin/puma:10:in `<top (required)>'
2015-08-11 .. +00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/bin/puma:23:in `load'
2015-08-11 .. +00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/bin/puma:23:in `<main>'
2015-08-11 .. +00:00 heroku[web.1]: State changed from starting to crashed
2015-08-11 .. +00:00 heroku[web.1]: Process exited with status 1
2015-08-11 .. +00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=salty-cove-3725.herokuapp.com request_id=fdda059e-0ce2-486a-b855-fedcb612368d 
2015-08-11 .. +00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=salty-cove-3725.herokuapp.com request_id=5e08ce0d-b815-4278-be4c-5e5ce636352d
2015-08-11 .. +00:00 heroku[web.1]: State changed from crashed to starting
2015-08-11 .. +00:00 heroku[web.1]: Starting process with command `bundle exec puma -C config/puma.rbbu`
2015-08-11 .. +00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/puma-2.11.1/lib/puma/configuration.rb:179:in `read': No such file or directory - config/puma.rbbu (Errno::ENOENT)
2015-08-11 .. +00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/puma-2.11.1/lib/puma/configuration.rb:179:in `_load_from'
2015-08-11 .. +00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/puma-2.11.1/lib/puma/configuration.rb:40:in `load'
2015-08-11 .. 00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/puma-2.11.1/lib/puma/cli.rb:453:in `run'
2015-08-11 .. +00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/puma-2.11.1/lib/puma/cli.rb:308:in `parse_options'
2015-08-11 .. +00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/puma-2.11.1/bin/puma:10:in `<top (required)>'
2015-08-11 .. +00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/bin/puma:23:in `load'
2015-08-11 .. +00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/bin/puma:23:in `<main>'
2015-08-11 .. +00:00 heroku[web.1]: Process exited with status 1
2015-08-11 .. +00:00 heroku[web.1]: State changed from starting to crashed
2015-08-11 .. +00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=salty-cove-3725.herokuapp.com request_id=188280eb-4424-4a09-8a77-5d8831450666
2015-08-11 .. +00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=salty-cove-3725.herokuapp.com request_id=4a0567fe-7819-40da-9aa2-cec5b341d48e
2015-08-11 .. +00:00 heroku[api]: Starting process with command `rails console` by heeycutie@yahoo.com
2015-08-11 .. +00:00 heroku[run.3262]: Awaiting client
2015-08-11 .. +00:00 heroku[run.3262]: Starting process with command `rails console`
2015-08-11 .. +00:00 heroku[run.3262]: State changed from starting to up
2015-08-11 .. +00:00 heroku[run.3262]: State changed from up to complete
2015-08-11 .. +00:00 heroku[run.3262]: Process exited with status 0

Looking through the logs, I found this first problem:

2015-08-11 .. +00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/puma-2.11.1/lib/puma/configuration.rb:179:in `read': No such file or directory - config/puma.rbbu (Errno::ENOENT)

It was trying to find a file named puma.rbbu in my /config folder, and the file wasn’t there. To address this, I set out to find the file.

Opening up my /config folder in Cloud 9, I saw that my puma file was named puma.rb, not puma.rbbu. I renamed the puma.rb file extension to puma.rbbu and then pushed the repository up to Heroku again.

This time it worked! My app is online and running here: https://salty-cove-3725.herokuapp.com/


Just a note:

I had my application on Bitbucket in a private repository. I had originally thought this was the reason why I was getting the Application Error page. I moved my Bitbucket repo over to Github into a public repo to test out if this was the case. The Application Error page still showed up. So it doesn’t matter whether your app is public or private. As long as you pushed your project onto Heroku successfully, something else is causing the error.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s