The idea behind tools like rbenv and RVM is that you don't need to use sudo
, because your entire Ruby environment exists inside your own workspace as a sandbox.
RVM allows multi-user configurations though it was originally designed for single users.
As far as I've ever seen or read, rbenv is single-user only. At no time should you need to use sudo
to manipulate or change your Ruby environment when using rbenv. If you do, something is wrong. If you try to use sudo
, you'll screw things up. You might not find out immediately but eventually something will pop up and you'll need to change the ownership of the files back to you.
On Linux and Mac OS you can do that pretty easily using:
sudo chown -R <your_user_name>:<your_group> ~/.rbenv
You have to run that as sudo
because only the super-user can change ownership of files owned by root. sudo
escalates your privileges to allow you to change those things.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…