我有两个(相同的)带有 nginx 配置的 rails 应用程序(与乘客一起使用):
> cat ./sites-available/app-production
server {
listen 80;
server_name app-development.mydomain.com;
root /path/to/my/production/app/public;
passenger_enabled on;
rails_env production;
rack_env production;
}
> cat ./sites-available/app-development
server {
listen 80;
server_name app-development.mydomain.com;
root /path/to/my/development/app/public;
passenger_enabled on;
rails_env development;
}
两者都有一个./config/mongoid.yml:
development:
sessions:
default:
database: app-development
hosts:
- localhost:27017
options:
consistency: :strong
options:
production:
sessions:
default:
database: app-production
hosts:
- localhost:27017
options:
consistency: :strong
options:
但是如果我同时启动它们,我会看到它们使用相同的数据库:我更改了一些数据development
,我也看到了这些更改production
。
即使我export RAILS_EVN="production"
,mongodb 使用developmnet db。如果 Phusion Passenger 返回一些错误,它会说 - 它正在运行开发模式。
如果这些还不够,还有什么其他配置。还是我有什么问题?