I\'m having a problem deploying my Rails app to Heroku, where this error is thrown when trying to access the app:
PGError: ERROR: relation \"organiz
I had the same problem. To solve it, resetting the database is more easier.
Then, migration was done successfully for my case :)
I keep my local setup as close to production as possible, including using a postgresql database, so I had this problem on my local machine. I can't delete my production database anyway. It turned out my issue was only in test, so I used: rake db:test:prepare to fix it.
I've had the same problem until I realized that I had to do:
heroku rake db:migrate
:)
In my case, the symptoms were the same, but the root cause and remedy turned out somewhat different. Spent hours on this. Hopefully this post will save someone else those hours! I am using:
Everything runs fine locally on SQLite, but get the same PG error on Heroku. Turns out that ActiveScaffold somehow prevents Heroku push from successfully running rake tasks due to an error similar to above. So you get a cache 22 where you get the same error if you try to run heroku rake db:migrate or similar.
Now the fix:
Comment out code blocks similar to following from all controllers that use "active_scaffold":
active_scaffold :<model_name> do |conf|
end
heroku run rake db:migrate
heroku run rails console
and then say creating a model and saving it.active_scaffold
block above)rake db:drop
rake db:create
rake db:migrate
After hours of sifting through answer, I realized that when you specify
rails new MYAPP -database POSTGRESQL
it changes the .gitignore file, ignoring the entire /db/ directory
, so my database was never getting pushed up to heroku. Remove it with caution, or at least don't have your username and password in there where you push up.