繁体   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