【问题标题】:pending migrations vs heroku rake db:seed待定迁移与 heroku rake db:seed
【发布时间】:2012-10-21 18:48:52
【问题描述】:

我正在尝试部署到 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)
$

【问题讨论】:

  • 好消息和坏消息,我已经成功推送了我的数据库(耶),坏消息是我不知道如何

标签: ruby-on-rails-3 heroku


【解决方案1】:

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

【讨论】:

  • 我不是!我只是表明 rake db:migrate 运行良好。
猜你喜欢
  • 2013-02-01
  • 1970-01-01
  • 2017-02-05
  • 2012-06-05
  • 1970-01-01
  • 2011-04-21
  • 2012-09-08
  • 2011-08-05
相关资源
最近更新 更多