blt04 / puppet-rvm

A puppet module for installing and using RVM (Ruby Version Manager)
Other
242 stars 280 forks source link

Gems folder is root only #69

Open ghost opened 11 years ago

ghost commented 11 years ago

I'm using this :

include 'rvm' 

rvm::system_user { vagrant: }

rvm_system_ruby { 'ruby-2.0.0':
  ensure => 'present',
  default_use => true,
}

After, I do "gem install bundler" and I get

ERROR:  While executing gem ... (Errno::EACCES)
    Permission denied - /usr/local/rvm/gems/ruby-2.0.0-p0/cache/bundler-1.3.2.gem

[vagrant@localhost ~]$ ls -al /usr/local/rvm/gems/ruby-2.0.0-p0/
total 28
drwxrwsr-x 7 root rvm  4096 Mar  7 12:45 .
drwxrwsr-x 6 root rvm  4096 Mar 12 11:15 ..
drwxr-xr-x 2 root root 4096 Mar  7 12:44 build_info
drwxr-xr-x 2 root root 4096 Mar  7 12:44 cache
drwxrwsr-x 3 root rvm  4096 Mar  7 12:45 doc
drwxr-xr-x 5 root root 4096 Mar  7 12:44 gems
drwxr-xr-x 3 root root 4096 Mar  7 12:44 specifications

I'm using Vagrant and CentOS 6.3

jaimeschettini commented 11 years ago

I have the same issue. What is the right way of solving it?

ghost commented 11 years ago

I chatted with maintainers on the rvm irc channel and the only way to fix this, since rvm is installed by root, is the change the permissions after installing your rubies.

exec { 'fix_rvm_permissions':
  command => '/bin/chmod -R 775 /usr/local/rvm ; /bin/chown -R :rvm /usr/local/rvm',
  require => Rvm_gem["${ruby_version}/rails"]
}
arruda commented 11 years ago

oh lord =/ well... at least it works right...