I have posted a couple other questions about a project I am working on, and I finally got it working to how I want it to.
I uploaded my stuff to heroku, and had to spend a couple hours figuring out how to get rid of all instances of sqlite3 and switch to PG. I got that fixed, but was still getting an error. Turned out to be a migration.
I ran heroku open
and got the error page. I ran heroku logs
and got this error;
2014-01-08T22:51:29.356850+00:00 app[web.1]: PG::Error: ERROR: relation "messages" does not exist
2014-01-08T22:51:29.356850+00:00 app[web.1]: LINE 1: SELECT "messages".* FROM "messages"
That error I remembered was for not running your migrations. So I then ran bundle exec rake db:migrate
, and then heroku run rake db:migrate
and I got the error;
Running `rake db:migrate` attached to terminal... up, run.9247
rake aborted!
Multiple migrations have the name CreateMessages
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:978:in `validate'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:876:in `initialize'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:764:in `new'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:764:in `up'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:742:in `migrate'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/railties/databases.rake:42:in `block (2 levels) in <top (required)>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
Originally I had 2 migration files with the same thing because I forgot about migrations. I manually went into db/migrate
and deleted one of them. I then did
git add .
git commit -m "message"
git push
then I ran
git push heroku master
to try and get it on the same level, but I still have this error. Does anyone know what I could do to fix this? Any help would be amazing.