我有一個基本的Rails 3應用程序,在我的開發框本地工作,但想要測試出早期部署以確保一切正常。我正在使用Capistrano進行部署。Rails 3 - Bundler/Capistrano錯誤
當我運行cap deploy
(畢竟其他必要的設置),它打破與此錯誤以下命令:
[...]
* executing 'bundle:install'
* executing "bundle install --gemfile /var/www/trex/releases/20100917172521/Gemfile --path /var/www/trex/shared/bundle --deployment --quiet --without development test"
servers: ["www.[my domain].com"]
[www.[my domain].com] executing command
** [out :: www.[my domain].com] sh: bundle: command not found
command finished
[...]
所以它看起來像它無法找到服務器上的bundle
命令。
然而,當我登錄到服務器...
$ ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux]
$ rails -v
Rails 3.0.0
$ bundle -v
Bundler version 1.0.0
...的bundle
命令的作品就好了。
可能會出現什麼問題?
-
(此外,完整性:)
$ which ruby
~/.rvm/rubies/ruby-1.9.2-p0/bin/ruby
$ which rails
~/.rvm/gems/ruby-1.9.2-p0/bin/rails
$ which bundle
~/.rvm/gems/ruby-1.9.2-p0/bin/bundle
我有RVM安裝系統範圍,並與本地用戶部署。爲了使它工作,我必須確保我正在部署的用戶已經設置了rvm的權利。在http://rvm.beginrescueend.com/rvm/install/這裏描述的.bashrc疑難解答幫助 – 2011-01-31 19:01:31
也許你會發現自己在這裏,如果你嘗試從這裏列出的rvm capistrano集成升級:http:// ariejan。 net/2011/09/14/lighting-fast-zero-downtime-deployments-with-git-capistrano-nginx-and-unicorn?utm_source = rubyweekly&utm_medium =發送電子郵件至此答案中提到的新方法。如果你刪除'default_environment'行,一定要刪除'default_run_options [:shell] ='bash'',否則你仍然不會在capistrano shell上擁有rvm。 – 2011-09-28 01:53:23
這對我不起作用。只有這樣:set:bundle_cmd,'source $ HOME/.bash_profile && bundle' – hipertracker 2011-11-27 03:41:14