luklapp
luklapp

Reputation: 205

rbenv: install ruby out of home-directory

I'm trying to install Ruby + Rails on Ubuntu 14.04. I need more than one user to have access to Ruby, so I installed rbenv with ruby-build in the /opt/.rbenv directory. Is that right?

If I try to install a version of Ruby using

rbenv install 2.1.3

it is installed in ~/username/.rbenv/versions, not in /opt/.rbenv/versions.

I don't want to give the second user access to the other user's home directory.

How can I install Ruby in /opt/.rbenv? Or is there another solution?

Upvotes: 2

Views: 2894

Answers (1)

Jan Werkhoven
Jan Werkhoven

Reputation: 2954

You can use the RBENV_ROOT environment variable:

sudo RBENV_ROOT=/opt/.rbenv rbenv install 2.1.3

See documentation.

Upvotes: 6

Related Questions