Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2012/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
Ruby 将Sinatra应用程序部署到暂存环境时出现问题_Ruby_Sinatra_Capistrano - Fatal编程技术网

Ruby 将Sinatra应用程序部署到暂存环境时出现问题

Ruby 将Sinatra应用程序部署到暂存环境时出现问题,ruby,sinatra,capistrano,Ruby,Sinatra,Capistrano,我有一个小型Sinatra应用程序,在一台运行Nginx的服务器上同时具有登台和生产环境。为了部署,我使用Capistrano和Capistrano ext轻松地部署到不同的位置 登台环境始终使用app.rb文件中指定的生产配置运行的问题 configure :staging do # staging settings set :foo, "bar" # will never be set to this end configure :production do # prod

我有一个小型Sinatra应用程序,在一台运行Nginx的服务器上同时具有登台和生产环境。为了部署,我使用Capistrano和Capistrano ext轻松地部署到不同的位置

登台环境始终使用app.rb文件中指定的生产配置运行的问题

configure :staging do
  # staging settings
  set :foo, "bar"   # will never be set to this
end

configure :production do
  # prod settings
  set :foo, "rab"
end
我得出结论,deploy.rb文件中的capistrano:environment变量没有以任何方式配置Sinatra。我还尝试将ENV[“RACK_ENV”]设置为“staging”,但没有效果

config/deploy/staging.rb

server "10.10.100.16", :app, :web, :db, :primary => true
set :deploy_to, "/var/www/staging.my_app" 
set :environment, "staging"
set :env, "staging"          
ENV["RACK_ENV"] = "staging" 
有什么想法吗


**更新:我应该补充一点,我也在使用Passenger。

在nginx中设置rack_env变量似乎可以做到这一点