简体   繁体   English

Rails.env.production? 在登台环境中返回true

[英]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.

相关问题 仅在Rails.env.production中进行某些验证? - Certain validations only in Rails.env.production? Rails + Rspec:如何测试环境特定的操作? 例如“......除非Rails.env.production?” - Rails + Rspec: How to test for environment specific actions? e.g. “… unless Rails.env.production?” rails 4 ruby​​条件基于ENV var和Rails.env.production? - rails 4 ruby conditional based on ENV var and Rails.env.production? rspec 如果 Rails.env.production? 返回字符串怎么实现呢? - rspec if Rails.env.production? return string how to implemented it? 我怎样才能得到Rails.env.production的等价物? 在application.js中 - How can I get the equivalent of Rails.env.production? in application.js 在哪里存储环境变量以进行登台/生产Rails应用 - Where to store env vars for staging / production rails apps 在登台和生产中是否需要设置ENV ['RAILS_ENV']和ENV ['RACK_ENV']? - Does ENV['RAILS_ENV'] and ENV['RACK_ENV'] need to be set in staging and production? heroku 上的暂存和生产环境 - Staging and production environment on heroku 开发环境测试与Rails中的暂存/生产不是100%兼容 - Dev Environment Tests Not 100% Compatible with Staging/Production in Rails 在Rails中测试暂存/生产环境的最佳方法是什么? - What is the best way to smoke test a staging/production environment in Rails?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM