简体   繁体   中英

How to add bundler to gemset with rvm (single user)?

There is error in Capistrano rails 3.1.3 deployment saying:

    [176.195.225.93] executing command
 ** [out :: 176.195.225.93] ←[31mERROR: Gem bundler is not installed, run `gem install bundler` first.←[m←(B

However gem list shows bundler 1.0.22. Our server is running rvm. It seems that the bundler was not added to the ruby gemset. Is there a way to add bundler to ruby gemset so the rvm will find bundler?

Thanks so much!

I suspect your path is not getting set, meaning that bundle cannot be found. You should be able to do something like this...

set :default_environment, {
'PATH' => "/usr/local/bin:/bin:/usr/bin:/bin:/<ruby-dir>/bin",
'GEM_HOME' => '<ruby-dir>/lib/ruby/gems/1.8',
'GEM_PATH' => '<ruby-dir>lib/ruby/gems/1.8',
'BUNDLE_PATH' => '<ruby-dir>/lib/ruby/gems/1.8/gems'  
}

as per this Stack Overflow answer

Alternatively, it is possible to configure your server to execute a profile when executing remote commands via ssh as per this answer

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM