簡體   English   中英

為什么當我在生產模式下啟動瘦服務器時,找不到我的用戶表,而在常規模式下卻找到了? -滑軌3

[英]Why when I start thin server in production mode it can't find my users table, but it does in regular mode ? - Rails 3

我試圖在生產中的應用中復制錯誤,但是當我像這樣啟動thin時:

thin -e production start

當我轉到主頁時,得到以下信息:

ActiveRecord::StatementInvalid in Devise::SessionsController#new

Could not find table 'users'

這很奇怪,因為一旦我這樣做:

thin start

該頁面現在可以使用了。

進入生產模式后,我是否必須運行一組新的遷移? 還是在生產模式下不喜歡SQLite?

謝謝。

假設config / database.yml正確設置,並且尚未設置生產數據庫,則需要:

rake db:setup RAILS_ENV="production"

設置您的生產數據庫。 此方法查看架構文件,而不是應用所有遷移,這是首選方法。

我希望這有幫助。

暫無
暫無

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

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