1
我上傳了我的本地文件到AWS,並且我做了rake db:migrate RAILS_ENV = production, 但它顯示錯誤...它正在處理我的本地環境,但它是不在生產上工作。rake db:migrate RAILS_ENV =生產不起作用
ActiveRecord::SchemaMigration Load (0.2ms) SELECT `schema_migrations`.* FROM `schema_migrations`
Migrating to DeleteTagCategories (20170422082951)
== 20170422082951 DeleteTagCategories: migrating ==============================
-- drop_table(:tag_categories)
(0.2ms) DROP TABLE `tag_categories`
rake aborted!
StandardError: An error has occurred, all later migrations canceled:
Mysql2::Error: Unknown table 'tag_categories': DROP TABLE `tag_categories`
解決此錯誤的最佳方法是什麼?
檢查你的遷移,似乎你有一個在生產中缺少的開發表('tag_categories')。 – Gerry
您應該使用'rake db:schema:load RAILS_ENV = production' – Iceman
感謝您的幫助!是的,這是正確的。我開發了一個表(tag_categories),並且在開發之前我已經刪除了它。我應該怎麼做才能解決這個問題? – Dan