2

This is similar to:

Using rvmsudo with Capistrano

I'm wondering if there is a specific switch in rvm/capistrano that enables rvmsudo. Without it I get errors like:

* executing "cd /home/Blog/releases/20110826194116 && bundle install --gemfile /home/Blog/releases/20110826194116/Gemfile --path /home/Blog/shared/bundle --deployment --quiet --without development test"
    servers: ["199.168.0.1"]
    [199.168.0.1] executing command
*** [err :: 199.168.0.1] /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:551:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
*** [err :: 199.168.0.1] 
*** [err :: 199.168.0.1] /usr/local/rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb
*** [err :: 199.168.0.1] creating Makefile
*** [err :: 199.168.0.1] 
*** [err :: 199.168.0.1] make
*** [err :: 199.168.0.1] sh: make: Permission denied
Community
  • 1
  • 1
Allyl Isocyanate
  • 13,306
  • 17
  • 79
  • 130
  • Since this was somewhat time critical, I went ahead and added an 'after deploy:update_code' filter that handles bundle update in rvmsudo. I also asked this on the RVM mailing list, no reply yet http://groups.google.com/group/rubyversionmanager/browse_thread/thread/cb85821e060dfe3d# – Allyl Isocyanate Aug 27 '11 at 18:48
  • Any particular reason why you're actually installing gems at the rvm level on deployment? I would suggest doing bundle install --deployment instead; it'll unroll an "installed copy" within the code tree for the code to use. – Nick Oct 07 '11 at 00:42
  • Good point Nick, ill look into that – Allyl Isocyanate Oct 17 '11 at 13:03

1 Answers1

0

I think that you can use the rvm envrionment variables like this as part of your deploy:

set :rvm_ruby_string, 'ruby-1.9.2-p290@some_gemset'
set :rvm_type, :user

then RVM commands will be scoped to this gemset and user.

heavysixer
  • 2,069
  • 17
  • 25
  • Clearly this isn't a concern for systems where rvm is installed for a user. You need rvmsudo for system installs. – JellicleCat Apr 24 '14 at 18:50