Ruby on rails 弄清楚为什么heroku应用程序没有';与本地主分支内容不匹配

Ruby on rails 弄清楚为什么heroku应用程序没有';与本地主分支内容不匹配,ruby-on-rails,git,heroku,Ruby On Rails,Git,Heroku,我正试图弄明白为什么我的heroku部署与我的本地Rails4 repo不同。特别是,我的许多迁移没有被复制,这在我远程运行应用程序时会造成各种各样的麻烦 以下是我的所有迁移(我正在本地应用程序的根目录下运行命令): 但当我运行以下命令时,我发现并非所有迁移都出现在heroku上: git config --list | grep heroku remote.heroku.url=https://git.heroku.com/voices-dev.git remote.heroku.fetch=

我正试图弄明白为什么我的heroku部署与我的本地Rails4 repo不同。特别是,我的许多迁移没有被复制,这在我远程运行应用程序时会造成各种各样的麻烦

以下是我的所有迁移(我正在本地应用程序的根目录下运行命令):

但当我运行以下命令时,我发现并非所有迁移都出现在heroku上:

git config --list | grep heroku
remote.heroku.url=https://git.heroku.com/voices-dev.git
remote.heroku.fetch=+refs/heads/*:refs/remotes/heroku/*
branch.master.remote=https://git.heroku.com/voices-dev.git

# make some local changes
touch a
git add .
git commit -m "add dummy file"

# push changes and check the contents of db/migrate on remote host
git push -uf https://git.heroku.com/voices-dev.git master

heroku run bash
ls db/migrate
20160402152001_create_users.rb  20160402214410_create_records.rb  20160402214520_add_attachment_file_upload_to_records.rb

其他人知道是什么原因导致我的一些本地文件没有出现在heroku上吗?我很感激别人能提供的任何帮助

天哪,我把
db/
添加到了我的gitignore中。我将把这个留在这里,以防其他人也会发疯。

您的本地数据库与您的heroku数据库不同。您必须运行heroku运行rake db:migrate以使它们匹配

谢谢Cacauzen,但问题是一些迁移没有复制到heroku,因为在编写一些迁移之前,我已将
db/
添加到
.gitignore
文件中。我没有注意到我以前没有将它们添加到本地主分支,但这就是我的本地迁移repo和我的远程/heroku托管迁移repo之间的a对称性的解释。太棒了!很高兴你弄明白了:)
git config --list | grep heroku
remote.heroku.url=https://git.heroku.com/voices-dev.git
remote.heroku.fetch=+refs/heads/*:refs/remotes/heroku/*
branch.master.remote=https://git.heroku.com/voices-dev.git

# make some local changes
touch a
git add .
git commit -m "add dummy file"

# push changes and check the contents of db/migrate on remote host
git push -uf https://git.heroku.com/voices-dev.git master

heroku run bash
ls db/migrate
20160402152001_create_users.rb  20160402214410_create_records.rb  20160402214520_add_attachment_file_upload_to_records.rb