【发布时间】:2012-10-08 20:01:23
【问题描述】:
我正在尝试在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
在输出中,添加的诊断代码清楚地表明存在非空 Gemfile:
* 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 副 --local,我会得到相同的结果。如果我删除 global/local 标志,我会得到一个不同的错误:
** [out :: my_server.com] Invalid scope --gemfile=/apps/my_app/releases/20121008194937/Gemfile given. Please use --local or --global.
似乎有一个全局配置或上下文使情况混乱。如何让bundle config 看到我的Gemfile?有没有更好的方法来做到这一点?
【问题讨论】:
标签: ruby-on-rails gem capistrano bundler