At the end of chapter 9 of the Hartl Rails tutorial (2nd Edition), an error occurred while populating db with the rake task. Ended up by resolving this, but not sure what went wrong. In case someone else hits this error, here is what I did. If anyone knows what went wrong, please comment - I would like to know. Thank!
Ran these teams
$ git push heroku
$ heroku run rake db:migrate
$ heroku pg:reset SHARED_DATABASE --confirm <name-heroku-gave-to-your-app>
$ heroku run rake db:populate
Then this error happened:
rake aborted!
PGError: ERROR: relation "users" does not exist
: SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"users"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
Tasks: TOP => db:populate
(See full trace by running task with
Failed to find out what happened. Then came across this post:
Heroku Postgres error: PGError: ERROR: the "organization" relationship does not exist (ActiveRecord :: StatementInvalid)
From this, I simply executed the following commands:
heroku run rake db:reset
heroku run rake db:migrate
heroku run rake db:populate
. , SHARED_DATABASE... - , .