NikolayMurha / chef-rvm

:exclamation: :exclamation: Needs a developer. I'll give this project into the caring hands. :exclamation: :exclamation:
MIT License
7 stars 18 forks source link

make rvm available system wide/ for all users #12

Open imewish opened 7 years ago

imewish commented 7 years ago

Hello,

can i use the LWRP's of this cookbook to install rvm for all users/ system wide ? is that possible ?

currently its only available for the user we prefer in the LWRP, for eg,

chef_rvm 'ubuntu' do
  rubies ['2.0.0', '2.1.1']
  rvmrc({
    'rvm_autoupdate_flag'=> '1'
  })
end

in this case its available for ubuntu only .

The idea behind system wide is to be able to use ruby with other users than ubuntu.

Helps would be appreciated.

axelrtgs commented 7 years ago

You can set ubuntu to any user you like, each user has to source the rvm file into their profile in order for the commands to work and the rubies install per user if my memory servers correctly.

I can look into the possibility of making a system wide rvm available to all users if i find some time between $dayjob and !wife

imewish commented 7 years ago

@axelrtgs Thanks for your valuable feed back.

I tried this way to make rvm available for all the users,

chef_rvm 'root' do
  rubies ['2.1','2.3','2.4' ]
  rvmrc({
    'rvm_autoupdate_flag'=> '1',
    'rvm_silence_path_mismatch_check_flag' =>'1'
  })
   action :install
end

and it worked. Its available for all users except root user.

The only issue i found is, after switching ruby versions , when i look for ruby location it shows like this

ubuntu@ip-10-10-92-242:~$ which ruby
/usr/local/rvm//rubies/ruby-2.4.0/bin/ruby
ubuntu@ip-10-10-92-242:~$ 

an additional / after rvm. But ruby works fine.