Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Homebrew Permissions mess

I installed Homebrew from my admin account. If I run brew doctor from that account I get no errors, but if I run brew doctor from my non-admin user account, I get warnings about several directories (usr/local and its subdirectories) not being writable, and suggestions that I chown them.

More recently, I installed RVM from my non-admin account (to ensure it was usable to that user and installed in their home directory). I then ran rvm install 1.9.3 (again, as non-admin) and got an error warning me that usr/local/bin isn't writable and is required for Homebrew. Running rvm requirements yields the same warning.

Am I supposed to install RVM as non-admin, switch to admin when I install ruby version with RVM, and then be able to use RVM (for everything other than installing) from the non-admin account? Or is something else wrong here?

The RVM output when I attempted to install 1.9.3 follows:

$ rvm install 1.9.3
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.8/x86_64/ruby-1.9.3-p448.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
ERROR: '/usr/local/bin' is not writable - it is required for Homebrew, try 'brew doctor' to fix it!
Requirements installation failed with status: 1.

It's been suggested to me that I shouldn't have installed Homebrew while logged in as an admin, so I should uninstall (as admin), then reinstall as a regular user. I tried this, but when I run the install script as a regular user, the first thing it tells me is:

$ ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
This script requires the user myuser to be an Administrator. If this
sucks for you then you can install Homebrew in your home directory or however
you please; please refer to our homepage. If you still want to use this script
set your user to be an Administrator in System Preferences or `su' to a
non-root user with Administrator privileges.

I imagine this is why I installed it as an admin in the first place. Any help clarifying this?

like image 376
ivan Avatar asked Sep 18 '13 03:09

ivan


People also ask

Does Homebrew change permissions?

Since Homebrew changes the permissions on /usr/local/bin to the user (see the preceding screenshot), the user (or any process running as the user) is able to write files to it and give those files executable permissions. ii.

Why is homebrew so slow?

brew list may be slower than it could be due to how some of the logic is overloaded - it's not used just for listing installed items, but also can filter by formulae only, casks only, unbrewed formulae, versions of a particular formula, pinned formulae only, etc.


1 Answers

I had the same problem, I had to read the doc and think a lot.

$ rvm autolibs read-only # read more here: https://rvm.io/rvm/autolibs $ rvm install ruby  # or any version you want 

This tells rvm to install ruby with current installed libs... default is read-fail which terminate rvm for missed requirements.

To use openssl (gem needs it, I had to rebuild ruby). Ask the computer admin install openssl with brew

$ brew install openssl  # if you want to install all dependencies run 'rvm requirements' $ rvm reinstall ruby or  $ rvm install ruby 
like image 168
carlitux Avatar answered Sep 18 '22 20:09

carlitux