Should Rbenv Be Installed System-Wide, or at a User Level

Should rbenv be installed system-wide, or at a user level?

About two years ago, a discussion happened in github about shared installs, which appears to answer the question.

Synopsis: sstephenson (rbenv author) specifically doesn't like encouraging system-wide installs because of complexities with permissions, write access, etc. He believes adding robust support would make rbenv more complex, and simplicity is the goal.

EDIT

I've since come across fnichol's chef-rbenv cookbook, which, if you actually want to install a system-wide rbenv, gives a right and proper method, and you can automate it with Chef (I recommend knife solo).

It installs this to /etc/profile.d/ so it will run for all users, putting the proper ruby into the PATH.

Which would work for a multi-user Ruby setup? RVM or RBenv?

Umm, RVM is definitely built for multiple users AS WELL AS per user installations. Please see the installation page for more information.

Also, please see the integration section and Passenger page in that section for using multiple gemsets with Passenger, however, Passenger is limited to a single Ruby.

For the ability to use any Ruby and any gemset within that Ruby's space, you want to set up Unicorn for that. You can easily use Apache and Unicorn or NGinx and Unicorn to accomplish all you want.

How to install gems with system wide rbenv by using chef

You need to use the rbenv_gem resource.

rbenv Permission denied with Assetic on Ubuntu

I do not have experience with the said components but assuming that the user who is executing the file is www-data it might be an issue with the permissions of the /root/.rbend/shims/ruby file.

Run the command sudo chmod o+x /root/.rbenv/shims/ruby wich will give execute permissions to the owner of the file, presumably www-data since you ran the chown command.

If it still doesn't work run the command ls -l /root/.rbenv/shims/ruby, the 4th character of the first column should be x, indicating the owner has execution permissions.

For more info on linux file permissions check "Understanding and Using File Permissions".

rbenv installation permission denied

It looks like the rbenv setup puts a line of shell scripting in your .bash_profile that attempts to create that directory. You could either give yourself permissions to create directories in /usr/local/rbenv, or sudo mkdir /directories/that/need/to/be/created once.

sudo mkdir -p /usr/local/rbenv/shims
sudo mkdir -p /usr/local/rbenv/versions

Capistrano with Bundler, rbenv fails to install pg gem

Solution

This problem was related to Chef deploying rbenv and installing bundler along with executing the proper installation for ruby-build. The problem was solved by configuring a VM by hand and launching the deploy process at it.

Vagrant provisioning - installing ruby version on rbenv fails

OK so after some digging I found this info on official ruby-build github page

So since I wanted to use provisioning and didn't want users to install anything by them own I added to Berksfile this cookbook:

cookbook 'libffi-dev', git: 'https://github.com/zchee/libffi-dev-cookbook'

abd to Vagrantfile this line:

chef.add_recipe "libffi-dev"

right after line with apt.

The whole project is here if anyone would like to play with it.



Related Topics



Leave a reply



Submit