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

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.

相关问题 生产模式(Apache和Thin)中的Rails 3找不到rubygems - Rails 3 in production mode (apache and thin) can't find rubygems 生产模式Rails 3.2.3瘦服务器中的SSL连接错误 - SSL connection error in production mode rails 3.2.3 thin server 在本地生产模式下启动Rails服务器 - Start rails server in production mode local 无法启动瘦服务器作为服务,RubyGems:找不到瘦 - Can't start thin server as service, RubyGems: Could not find thin 为什么WEBrick服务器在生产模式下比在开发模式下更快? +滑轨 - Why WEBrick server is faster in production mode rather in development mode? + Rails Rails-Thin服务器停止在生产(实时)模式下。 - Rails-Thin server stopped on Production(live) mode.Website down 为什么我不能启动我的网络服务器(`rails server`)? - Why can't I start my webserver (`rails server`)? 如何使用unicorn和配置文件在生产模式下启动rails服务器? - How to start rails server in production mode using unicorn and config file? 当我运行`rails server`时,如何让'puma'自动启动(就像Thin一样) - How do I get 'puma' to start, automatically, when I run `rails server` (like Thin does) 在Heroku上使用rails sync gem与Faye和Thin在生产模式下 - Using rails sync gem with Faye and Thin in production mode on Heroku
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM