2012-10-03 24 views
0

可能重复:
Heroku automatically changing RAILS_ENV and RACK_ENV variables to “production” on every deploy的Heroku /耙覆盖RAILS_ENV

我目前正在写一耙脚本将运行,我需要做的部署,以我的升级应用程序的命令那将使用asset_sync将我的资产复制到我的cdn。

namespace :deploy do 
desc 'Deploy the app' 
task :staging do 
    app = "app-name" 
    remote = "[email protected]:#{app}.git" 

    system "git push #{remote} master" 
    system "heroku run rake assets:precompile --app #{app}" 
end 

然而,当我运行此的Heroku是覆盖我RAILS_ENV(其中包括)恢复生产。

运行的Heroku发布之后

v143 Deploy 2b3aa3f        10m ago 
v142 Add RAILS_ENV, RACK_ENV, PATH, LANG, G.. 10m ago 

任何想法,为什么它可能这样做?

非常感谢

菲尔

回答

1

另一个用户experiencing the same issue。鉴于你配置了变量,也许是一个Heroku的错误。

试着在Heroku打开一张票。

如果还没有configured the variables,请务必将Ruby environmentRAILS_ENVRACK_ENV更改为staging

$ heroku config:add RAILS_ENV=staging 
$ heroku config:add RACK_ENV=staging 
+0

谢谢!! - 假设Heroku同时编写一个rake任务的时机很差,开发了一个相关的bug。 –