[英]Rails.env.production? returns true in staging environment
I've got two rails apps deployed on heroku. 我在heroku上部署了两个Rails应用程序。 One in staging - the other in production environment.
一个在舞台上-另一个在生产环境中。 I have also set up a staging.rb file in my config directory.
我还在配置目录中设置了一个staging.rb文件。 For deploying to my staging app, I use "git push staging master" but the condition Rails.env.production?
为了部署到我的登台应用程序,我使用“ git push登台主服务器”,但条件是Rails.env.production? still returns true, which I only want in my prod app.
仍然返回true,这只是我在prod应用程序中想要的。 What am I missing?
我想念什么?
you have to set environment to staging
in heroku. 您必须将环境设置为在heroku中进行
staging
。 So, you have to use this command 因此,您必须使用此命令
heroku config:set RAILS_ENV=staging
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.