簡體   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