待迁移vs heroku rake db:seed

时间:2012-10-21 03:17:14

标签: ruby-on-rails-3 heroku

我正在尝试部署到heroku,我遇到了一个问题: 当我运行heroku rake db:seed(在我的数据库中创建管理员用户)时,rails返回我有待处理的迁移。 我已经手动删除了这些迁移(我不知道,我知道),我该如何解决这个问题?

Charlie@CHARLIE-PC /c/rails/rails_projects/METACRITIC (master)
$ rake db:migrate

Charlie@CHARLIE-PC /c/rails/rails_projects/METACRITIC (master)
$ heroku run rake db:seed
Running `rake db:seed` attached to terminal... up, run.1
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support
 for these plugins will be removed in Rails 4.0. Move them out and bundle them i
n your Gemfile, or fold them in to your app as lib/myplugin/* and config/initial
izers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonr
ails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required
)> at /app/Rakefile:7)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support
 for these plugins will be removed in Rails 4.0. Move them out and bundle them i
n your Gemfile, or fold them in to your app as lib/myplugin/* and config/initial
izers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonr
ails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required
)> at /app/Rakefile:7)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support
 for these plugins will be removed in Rails 4.0. Move them out and bundle them i
n your Gemfile, or fold them in to your app as lib/myplugin/* and config/initial
izers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonr
ails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required
)> at /app/Rakefile:7)
You have 2 pending migrations:
  20121013054027 Addcolumnimagetoshow
  20121013063205 AddAttachmentToShows
Run `rake db:migrate` to update your database then try again.

Charlie@CHARLIE-PC /c/rails/rails_projects/METACRITIC (master)
$

1 个答案:

答案 0 :(得分:2)

您在本地运行迁移(rake db:migrate)而不是运行on heroku heroku run rake db:migrate