繁体   English   中英

当我尝试执行rake db:migrate

[英]When I try to do a rake db:migrate

您好开发人员我遇到了麻烦

当我尝试执行rake db:migrate时,它返回警告,但似乎没有进行迁移。 这是错误:

sanchez@danik21:/var/www/nubedianWebSite$ rake db:migrate
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 in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /var/www/nubedianWebSite/Rakefile:7)
sanchez@danik21:/var/www/nubedianWebSite$

然后我有这个错误:

Started GET "/" for 141.21.12.238 at 2014-04-10 10:27:49 +0200
Processing by Refinery::PagesController#home as HTML
  Parameters: {"locale"=>:de}
Completed 500 Internal Server Error in 7ms

ActiveRecord::StatementInvalid (Could not find table 'refinery_roles'):
  app/models/refinery/role.rb:14:in `[]'

我将rails 3.2.6与fineryCMS一起使用。

希望您早日得到答复。 安东尼奥

如前所述,您看到的不是错误,而是警告。 升级到Rails 4.0时,您将需要更改供应商插件,但是鉴于您使用的是3.2.6,现在可以忽略它。

rake db:migrate没有提供任何其他输出的事实意味着没有任何事情可做。 这可能意味着您认为正在加载的迁移已应用于数据库。 您说表已创建; 这是迁移已被应用的另一个迹象。

迁移的文件名将以14位数字开头。 在数据库中将有一个名为schema_migrations的表。 该表中只有一列: version 如果此表中有该14位数字的条目,则说明已经应用了迁移,因此再次运行rake db:migrate将无济于事。

除非您将其回滚,否则迁移仅应应用于每个环境一次。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM