Install ruby for all users on ubuntu

820 Views Asked by At

I installed the ruby on rails by https://gorails.com/setup/ubuntu/18.10.

It's successfully installed on current user.

When I changed the user, for example root, ruby and rails is not installed.

How can I make ruby & rails working on all users?

1

There are 1 best solutions below

0
On BEST ANSWER

I'm assuming you are installing Ruby using Rbenv method from the GoRails guide. Take a look at This Q/A.

I also wanted to use system-wide ruby for different user and used the above method(despite the warning that Rbenv is not suitable for system-wide configs), and it worked in some way, but I had problems using it for other projects with different users.

So the workaround I use is to install Rbenv each for a different user. It takes some disk space, but things will work smoothly. Also, DO NOT install it as a root user or in the /root folder as this will break things when you work with rails with different users.