Deployment Heroku/Rake覆盖RAILS\u ENV
可能重复:Deployment Heroku/Rake覆盖RAILS\u ENV,deployment,heroku,rake,staging,Deployment,Heroku,Rake,Staging,可能重复: 我目前正在尝试编写一个Rake脚本,该脚本将运行我需要的命令,以便部署到我的登台应用程序,使用asset_sync将我的资产复制到我的cdn namespace :deploy do desc 'Deploy the app' task :staging do app = "app-name" remote = "git@heroku.com:#{app}.git" system "git push #{remote} master" system "hero
我目前正在尝试编写一个Rake脚本,该脚本将运行我需要的命令,以便部署到我的登台应用程序,使用asset_sync将我的资产复制到我的cdn
namespace :deploy do
desc 'Deploy the app'
task :staging do
app = "app-name"
remote = "git@heroku.com:#{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
你知道为什么会这样吗
非常感谢
菲尔另一个用户正在使用。如果您配置了变量,可能是一个Heroku bug
试着在Heroku开一张票
如果还没有,请确保将RAILS\u ENV
和RACK\u ENV
更改为staging
$ heroku config:add RAILS_ENV=staging
$ heroku config:add RACK_ENV=staging
谢谢假设在Heroku开发相关bug的同时编写rake任务的时机不好。