[英]Why when I start thin server in production mode it can't find my users table, but it does in regular mode ? - Rails 3
I am trying to replicate an error in my app in production, but when I launch thin like this: 我试图在生产中的应用中复制错误,但是当我像这样启动thin时:
thin -e production start
When I go to my main page I get this: 当我转到主页时,得到以下信息:
ActiveRecord::StatementInvalid in Devise::SessionsController#new
Could not find table 'users'
Which is strange because once I do: 这很奇怪,因为一旦我这样做:
thin start
That page now works. 该页面现在可以使用了。
Do I have to run a new set of migrations now that I am in production mode ? 进入生产模式后,我是否必须运行一组新的迁移? Or is it that in production mode it doesn't like SQLite ?
还是在生产模式下不喜欢SQLite?
Thanks. 谢谢。
Assuming config/database.yml is setup correctly, and that you have not setup your production database, you will need to: 假设config / database.yml正确设置,并且尚未设置生产数据库,则需要:
rake db:setup RAILS_ENV="production"
to setup your production database. 设置您的生产数据库。 This method looks at the schema file instead of applying all your migrations which is the preferred method.
此方法查看架构文件,而不是应用所有迁移,这是首选方法。
I hope this helps. 我希望这有帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.