Ruby on rails Capistrano任务中的捆绑包配置找不到文件

Ruby on rails Capistrano任务中的捆绑包配置找不到文件,ruby-on-rails,gem,capistrano,bundler,Ruby On Rails,Gem,Capistrano,Bundler,我正在尝试在deploy.rb中添加一个配置参数,以便pggem正确构建: before "bundle:install" do run "ls -l #{fetch(:latest_release)}/Gemfile" run "bundle config --local --gemfile=#{fetch(:latest_release)}/Gemfile build.pg --with-pg-config=/usr/pgsql-9.1/bin/pg_config" end 在输

我正在尝试在
deploy.rb
中添加一个配置参数,以便
pg
gem正确构建:

before "bundle:install" do
  run "ls -l #{fetch(:latest_release)}/Gemfile"
  run "bundle config  --local --gemfile=#{fetch(:latest_release)}/Gemfile build.pg --with-pg-config=/usr/pgsql-9.1/bin/pg_config"
end
在输出中,添加的诊断代码清楚地显示存在非空文件:

  * executing `bundle:install'
    triggering before callbacks for `bundle:install'
  * executing "ls -l /apps/my_app/releases/20121008195429/Gemfile"
    servers: ["my_server.com"]
    [my_server.com] executing command
 ** [out :: my_server.com] -rw-r--r-- 1 webapp webapp 1291 Oct  5 22:34 /apps/my_app/releases/20121008195429/Gemfile
    command finished in 157ms
  * executing "bundle config  --local --gemfile=/apps/my_app/releases/20121008195429/Gemfile build.pg --with-pg-config=/usr/pgsql-9.1/bin/pg_config"
    servers: ["my_server.com"]
    [my_server.com] executing command
 ** [out :: my_server.com] Could not locate Gemfile
如果我使用
--global
vice
--local
,我会得到相同的结果。如果我删除
全局
/
本地
标志,则会出现不同的错误:

** [out :: my_server.com] Invalid scope --gemfile=/apps/my_app/releases/20121008194937/Gemfile given. Please use --local or --global.
似乎有一个全局配置或上下文使情况变得混乱。如何使
bundle配置
查看我的
Gemfile
?有更好的方法吗?

bundle install
命令中使用的
--gemfile
标志相比,
bundle config
中的标志仅标识gemfile的名称

# man bundle-config
...
gemfile (BUNDLE_GEMFILE)
The name of the file that bundler should use as the Gemfile. This location of this file
also sets the root of the project, which is used to resolve relative paths in the Gemfile,
among other things. By default, bundler will search up from the current working directory
until it finds a Gemfile.
我通过先将cd'刻录到该目录修复了该问题:

run "cd #{fetch(:latest_release)} && bundle config build.pg --with-pg-config=/usr/pgsql-9.1/bin/pg_config"
更多信息:
&

每当出现捆绑配置问题时,总是pg配置才是罪魁祸首。为什么?