I am working in Ruby on Rails.
I am updating a database with users locally:
- Using the "rails console"
- Running rails server
- Checking on localhost:3000
The users are added on my local host.
I then try and run steps 3-7
- Make changes to local code
- Run any migrations LOCALLY
- Add all changed files to Git git add .
- Commit all added files to git git commit -m "Adding features"
- Push the changes to Heroku git push heroku master - assuming you are using heroku as your remote name and you are working in the master branch
- If you have migrations run heroku run rake db:migrate to run the migrations ON HEROKU
- Following migrations do heroku restart
After step 6 I get this as a result:
"Running `rake db:migrate` attached to terminal... up, run.5819
Migrating to CreateUsers (20140812155921)
== 20140812155921 CreateUsers: migrating ======================================
-- create_table(:users)
-> 0.0572s
== 20140812155921 CreateUsers: migrated (0.0574s) =============================
Migrating to AddIndexToUsersEmail (20140812200300)
== 20140812200300 AddIndexToUsersEmail: migrating =============================
-- add_index(:users, :email, {:unique=>true})
-> 0.0252s
== 20140812200300 AddIndexToUsersEmail: migrated (0.0254s) ====================
Migrating to AddPasswordDigestToUsers (20140812204144)
== 20140812204144 AddPasswordDigestToUsers: migrating =========================
-- add_column(:users, :password_digest, :string)
-> 0.0039s
== 20140812204144 AddPasswordDigestToUsers: migrated (0.0041s) ================
Migrating to AddRememberTokenToUsers (20140814171549)
== 20140814171549 AddRememberTokenToUsers: migrating ==========================
-- add_column(:users, :remember_token, :string)
-> 0.0067s
-- add_index(:users, :remember_token)
-> 0.0171s
== 20140814171549 AddRememberTokenToUsers: migrated (0.0275s) =================
Migrating to AddAdminToUsers (20140815204326)
== 20140815204326 AddAdminToUsers: migrating ==================================
-- add_column(:users, :admin, :boolean, {:default=>false})
-> 0.0963s
== 20140815204326 AddAdminToUsers: migrated (0.0977s) =========================
Migrating to CreateMicroposts (20140815212754)
== 20140815212754 CreateMicroposts: migrating =================================
-- create_table(:microposts)
-> 0.0256s
-- add_index(:microposts, [:user_id, :created_at])
-> 0.0350s
== 20140815212754 CreateMicroposts: migrated (0.0611s) ========================
Migrating to CreateRelationships (20140816000750)
== 20140816000750 CreateRelationships: migrating ==============================
-- create_table(:relationships)
-> 0.0217s
-- add_index(:relationships, :follower_id)
-> 0.0385s
-- add_index(:relationships, :followed_id)
-> 0.0195s
-- add_index(:relationships, [:follower_id, :followed_id], {:unique=>true})
-> 0.0226s
== 20140816000750 CreateRelationships: migrated (0.1057s) ====================="
When I do: heroku open
and try to log in it now says my user information is invalid and heroku support says there are no user records.
Does anyone know what I can do here? This folder was also copied over from another project I was working on, so I deleted the .git file and created a new repository. I just don't know why my database will work locally but not on heroku.
Thanks much.
Best, David
Aucun commentaire:
Enregistrer un commentaire