簡體   English   中英

ActiveRecord::StatementInvalid(找不到表)

[英]ActiveRecord::StatementInvalid (Could not find table)

我在 DigitalOcean 上有一個 Rails 應用程序。 我正在使用舒適的墨西哥沙發 CMS。 我添加了 gem 並運行rails generate comfy:cmsrake db:migrate但是當我導航到 example.com/admin 時,出現 500 錯誤並且我的應用程序無法找到必要的表。 這是我在日志中得到的錯誤。

I, [2014-06-24T21:51:18.397255 #18789]  INFO -- : Started GET "/" for 173.10.20.190 at 2014-06-24 21:51:18 +0000

I, [2014-06-24T21:51:18.425183 #18789]  INFO -- : Processing by HomeController#index as HTML

I, [2014-06-24T21:51:18.442366 #18789]  INFO -- :   Rendered home/index.html.erb within layouts/application (1.2ms)

I, [2014-06-24T21:51:18.445116 #18789]  INFO -- : Completed 200 OK in 20ms (Views: 9.5ms | ActiveRecord: 0.0ms)

I, [2014-06-24T21:51:18.599085 #18786]  INFO -- : Started GET "/assets/rails.png" for 173.10.20.190 at 2014-06-24 21:51:18 +0000

I, [2014-06-24T21:51:23.516755 #18789]  INFO -- : Started GET "/admin" for 173.10.20.190 at 2014-06-24 21:51:23 +0000

I, [2014-06-24T21:51:23.522184 #18789]  INFO -- : Processing by Comfy::Admin::Cms::BaseController#jump as HTML

I, [2014-06-24T21:51:23.526053 #18789]  INFO -- : Completed 500 Internal Server Error in 4ms

F, [2014-06-24T21:51:23.532357 #18789] FATAL -- :

ActiveRecord::StatementInvalid (Could not find table 'comfy_cms_sites'):

對我來說似乎很奇怪的是,當我運行rails cActiveRecord::Base.connection.tables ,表格會出現並且“comfy_cms_sites”在那里。

確保您已在生產數據庫上運行遷移

rake db:migrate RAILS_ENV=production

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM