##Problem: While trying to deploy an app to heroku, a table was chronically not found, preventing asset precompile.
Migrating the db on heroku would seem successfull, but trying to push to heroku would result in this error:
remote: Running: rake assets:precompile
remote: rake aborted!
remote: ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR: relation "********" does not exist
.
.
.
remote: ! Precompiling assets failed.
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to ********.
remote:
To *****heroku url*****
! [remote rejected] staging -> master (pre-receive hook declined)
error: failed to push some refs to '*****heroku url*****'
##Solution
I don't know why, but the table seemed to be actually missing, and migrating wasn't creating it. I had to drop the database and rebuild it.
heroku pg:reset DATABASE --app appname
where appname is the name of the app on heroku.
This is not ideal, as it destroys the database. This should not be used in production since data will be lost.
Well, I guess that didn't work. Still having the same problem, only now the missing table is one that actually should be there.
Still, it's good to not have unused tables floating around.