postmodern / chruby

Changes the current Ruby
MIT License
2.85k stars 190 forks source link

How to set all ruby to new installed one whatever the root user or sudo command? #362

Open run27017 opened 8 years ago

run27017 commented 8 years ago

I am using openSuse Leap 42.1 and ruby 2.1 is installed as default. Now I want to replace it by ruby 2.3 through chruby. The new ruby is installed in directory /opt/rubies/ruby2.3, and following the tutorial I successfully set the ruby as default ruby of my own user. However, there are still two issues:

  1. The ruby version of root user is not changed. (which ruby is not 'opt/rubies/ruby2.3/bin/ruby')
  2. The ruby version is not changed when I type sudo command.

I have tried some methods searched through Google and actually they all do not work any more.

On the other hand, I also want to change the gem and bundle and rake to the new installed ruby 2.3 related.

I am looking forward to the replay. Thank you!

jayeff commented 8 years ago

Hi,

ad 1. Make sure to enable chruby for the root user (see README) or system-wide for all users. ad 2. Please read the wiki page for usage with sudo.

Hope this helps.