Heroku - Application Error

I created a simple application with Ruby on Rails, and Ive tried to transfer it to Heroku. Ive followed this “Getting Started Guide to Heroku” , I finished it and tried to open my page, but I still see the error: Application Error:

An error occurred in the application and your page could not be served. Please try again in a few minutes.

If you own the app, check your logs for details.

Does anyone know how to deal with this?


I do not know what happened, but I took this step, unfortunately, I have another problem, I ran several commands:

# git add.
# git commit -m "my commit"
Do not commit anything in the branch branch (working directory is cleared)
# git push heroku master All relevant
# Discovery of the hero Discovery http://eerie-meadow-9207.heroku.com/
# reloading the hero Restarting processes ... done
# Discovery of the hero Discovery http://eerie-meadow-9207.heroku.com/

And I see a message:

We are sorry, but something went wrong.

We have been notified of this issue and we will review it shortly.

From heroku logs [timestamps removed for clarity]:

 app[web.1]: Started GET "/" for 77.236.11.34 at 2011-10-31 11:50:38 -0700 app[web.1]: Processing by StoreController#index as HTML app[web.1]: Completed 500 Internal Server Error in 3ms heroku[router]: GET eerie-meadow-9207.heroku.com/ dyno=web.1 queue=0 wait=0ms service=13ms status=500 bytes=728 heroku[nginx]: 77.236.11.34 - - [31/Oct/2011:11:50:38 -0700] "GET / HTTP/1.1" 500 728 "-" "Mozilla/5.0 (X11; U; Linux i686; pl-PL; rv:1.9.2.23) Gecko/20110921 Ubuntu/10.04 (lucid) Firefox/3.6.23" eerie-meadow-9207.heroku.com app[web.1]: heroku[web.1]: State changed from up to bouncing heroku[web.1]: State changed from bouncing to created heroku[web.1]: State changed from created to starting heroku[web.1]: Starting process with command `thin -p 40376 -e production -R /home/heroku_rack/heroku.ru start` heroku[web.1]: Process exited app[web.1]: >> Maximum connections set to 1024 app[web.1]: >> Listening on 0.0.0.0:40376, CTRL+C to stop app[web.1]: >> Thin web server (v1.2.6 codename Crazy Delicious) heroku[web.1]: State changed from starting to up app[web.1]: app[web.1]: Started GET "/" for 77.236.11.34 at 2011-10-31 11:50:59-0700 app[web.1]: app[web.1]: Processing by StoreController#index as HTML app[web.1]: Completed 500 Internal Server Error in 4ms app[web.1]: app[web.1]: ActiveRecord::StatementInvalid (PGError: ERROR: relation "products" does not exist app[web.1]: : SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull app[web.1]: FROM pg_attribute a LEFT JOIN pg_attrdef d app[web.1]: ON a.attrelid = d.adrelid AND a.attnum = d.adnum app[web.1]: WHERE a.attrelid = '"products"'::regclass app[web.1]: AND a.attnum > 0 AND NOT a.attisdropped app[web.1]: ORDER BY a.attnum app[web.1]: ): app[web.1]: app/controllers/store_controller.rb:3:in `index' app[web.1]: app[web.1]: app[web.1]: cache: [GET /] miss heroku[router]: GET eerie-meadow-9207.heroku.com/ dyno=web.1 queue=0 wait=0ms service=81ms status=500 bytes=728 heroku[nginx]: 77.236.11.34 - - [31/Oct/2011:11:50:59 -0700] "GET / HTTP/1.1" 500 728 "-" "Mozilla/5.0 (X11; U; Linux i686; pl-PL; rv:1.9.2.23) Gecko/20110921 Ubuntu/10.04 (lucid) Firefox/3.6.23" eerie-meadow-9207.heroku.com app[web.1]: app[web.1]: app[web.1]: Started GET "/" for 77.236.11.34 at 2011-10-31 11:54:00-0700 app[web.1]: Processing by StoreController#index as HTML 

I can’t understand this, because on my netbook it works on localhost, any ideas?

+8
ruby-on-rails heroku
source share
5 answers

In most cases, problems with the gerok are related to the lack of privileges to access the file system. For your application to work on heroku, you must make sure that it does not try to write anything to disk (but to a temporary folder).

A typical example is the js / css compilation process, for example. with a compass for which you will find the solution in your knowledge base: http://devcenter.heroku.com/articles/using-compass

In heroku logs, you should see if there is any “denial of access” problem when starting the application or during the first requests.

+5
source share

Try using the command

heroku run rake db:migrate

+19
source share

Try restarting the application with heroku restart . Assuming your application runs fine locally, this should do the trick. He solved the problem for me, as I only reorganized the circuit and db: reset did not seem to do this trick.

+14
source share

http://www.youtube.com/watch?v=p_3dIPgXgkg

If you have already created your application, go to the point in the video when it starts clicking on the sample application on the hero. Unfortunately, it’s hard for the hero to solve errors when loading 3.1 applications for the first time. Follow the troubleshooting steps for the video and everything will be fine.

+2
source share

I have the same problem. Look at your Procfile and see if you added the correct command to it, such as web: python run.py I could not connect, then placed the heroku logs --tail to see what the problem was, and saw what was in my Procfile an error like, for example >>> web: oython run.py <<< web: oython run.py application does not work. So pay attention to this.

0
source share

All Articles