2
我想在deploy.rb
添加一個配置參數,以便pg
寶石建立正確:束配置無法找到的Gemfile
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
?有一個更好的方法嗎?
每當有一個bundle配置問題,總是pg-config是罪魁禍首。爲什麼?!! –