简体   繁体   中英

Rails deployment with capistrano and bundler

I want to deploy an rails app on a server, where the following setup is given.

Systemwide installed is ruby and rubygems. As user i installed bundler and added the ~/.gems/bin to the path.

inside the Capfile i set bundle_cmd to the local installation like

set :bundle_cmd, "/home/user/.gems/bin/bundle"

calling "bundle" from the cap shell is giving me the following error

/usr/lib/ruby/1.8/rubygems.rb:779:in `report_activate_error': Could not find RubyGem bundler (>= 0) (Gem::LoadError)
/usr/lib/ruby/1.8/rubygems.rb:214:in `activate'
/usr/lib/ruby/1.8/rubygems.rb:1082:in `gem'
/home/user/.gems/bin/bundle:18

Any ideas?

Okay, i could install bundler as root but is that possible without?

The problem is that the cap shell doesnt get your settings from the bashrc like GEM_HOME or the path of bundler.

I tried it before with

source .bashrc && bundle

but that didnt do the trick for me.

set :bundle_cmd, "export GEM_HOME=/home/user/.gems;export PATH=$PATH:/home/user/.gems/bin && bundle"

does work though.

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