當我執行耙COMAND,這是我所得到的:你有1個待遷移:20140415221104個CreateBoxesAndBoxesSuppliers
You have 1 pending migrations:
20140415221104 CreateBoxesAndBoxesSuppliers
Run `rake db:migrate` to update your database then try again.
當我執行耙COMAND,這是我所得到的:你有1個待遷移:20140415221104個CreateBoxesAndBoxesSuppliers
You have 1 pending migrations:
20140415221104 CreateBoxesAndBoxesSuppliers
Run `rake db:migrate` to update your database then try again.
由於錯誤提示,所有你需要做的就是運行rake db:migrate
。
按照錯誤,Mysql2::Error: Table 'boxes' already exists
, 你已經從另一個遷移創建boxes
表,並與20140415221104 CreateBoxesAndBoxesSuppliers
遷移您試圖再次創造boxes
。
您不應該在20140415221104 CreateBoxesAndBoxesSuppliers
遷移中再次創建boxes
表。
我已經使用它,它不起作用。 – user3557451
你會得到什麼錯誤?這是你得到的唯一錯誤嗎?如果沒有,請分享完整的錯誤日誌。另外,當您執行'rake db:migrate'時,您獲得了什麼輸出,遷移是否成功?請分享 –
這就是我用rake db得到的結果:migrate'== CreateBoxesAndBoxesSuppliers:migrating ============================== ===== - create_table(:boxes,{:options =>「DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci」}) rake中止! 發生錯誤,所有後來的遷移取消:' – user3557451
發佈您的遷移文件'20140415221104_create_boxes_and_boxes_suppliers.rb' – Pavan