Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Deployment Heroku/Rake覆盖RAILS\u ENV_Deployment_Heroku_Rake_Staging - Fatal编程技术网

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任务的时机不好。