0

When running my RoR app in Heroku shows this error:

We're sorry, but something went wrong.

If you are the application owner check the logs for more information.

Checking the heroku logs, this shows http://pastebin.com/yTWtRMVD

My main page is https://salty-stream-26420.herokuapp.com/ and my callback URL is https://salty-stream-26420.herokuapp.com/auth/twitter/callback in OmniAuth.

It runs in Cloud9 perfectly but not in Heroku. What is wrong?

Thank you, Alex.

avm_69
  • 183
  • 2
  • 11

2 Answers2

0

This:

2016-05-03T13:47:23.544506+00:00 app[web.1]: PG::UndefinedTable: ERROR:  relation "submissions" does not exist

suggests to me that you have to simply migrate your database on the remote server.

Try running heroku run rake db:migrate

Vincent
  • 1,454
  • 2
  • 17
  • 24
  • 1
    There might be something amiss or out of order with your migrations. You might be able to diagnose this by starting another dev environment on your machine or a virtual box and trying to set up the database. I reckon you might come across the same error locally if you `rake db:drop` and reset it. – Vincent May 03 '16 at 23:50
0

You will have to create environment variables in the config/database.yml file for the username, password and database name

Those same environment variables need to be defined under

Heroku login >> application >> settings >> reveal config vars

By default you will get a DATABSE_URL something as

postgres://wwwbirawxqwmws:7bef28c02299c9c6054a646b5ce19276bbab52feca6692dac8305b32dbd7d36c@ec2-81-XX-XXX-X26.compute-1.amazonaws.com:5432/d6n59y5r09ko99

where wwwbirawxqwmws is USER and 7bef28c02299c9c6054a646b5ce19276bbab52feca6692dac8305b32dbd7d36c is PASSWORD and d6n59y5r09ko99 is the DATABASE

These three variables needs to be assigned in the heroku config, then you will be able to run

            heroku run rake db:create

            heroku run rake db:migrate
Kwaghray
  • 39
  • 2
  • 9