Installing packages without linking #18971

also opened this Issue Apr 4, 2013 · 5 comments


None yet

5 participants

also commented Apr 4, 2013

I'd like to install several versions of Ruby (or really any Homebrew package) without linking any of them. Basically, I'd like to treat any formula as keg-only.

I can't seem to find a way to do this, although it seems trivial. I thought there'd be something like brew install --no-link .

Is there a way to do what I want, or some reason why this is a bad idea?

I'd really like to use Homebrew to install Ruby versions, and rbenv to manage them.

(originally posted


brew install ruby; brew unlink ruby will do it. Doesn't seem a particularly bad idea but if you put rbenv before Homebrew in your path that'll achieve the same.


Right now the doctor warns if not-keg_only-formulae are unlinked.
I know keg_only formulae are specially handled (they are being added to CFLAGS etc.). Is the same done for unlinked "normal" formulae? Until this is not done, we should hold back a brew install --no-link option because it can break other builds. I am not sure about this - would need to check the source.

Besides that, I think a --no-link option might be worth considering. I heard a similar request several times. Though, I don't have a strong opinion on this.

Sharpie commented Apr 7, 2013

Honestly, if you want to install multiple Rubies, I would just brew install rbenv ruby-build and let Rbenv/Ruby-build take it from there. You may need to manually set some CFLAGS (see the ruby-build wiki), but the end result is pretty easy to work with.


Agreed, and you may run into other subtle issues in trying to use Homebrew as a Ruby version manager. For example, the install names of the shared libraries will point at HOMEBREW_PREFIX/lib rather than any specific keg, which seems likely to cause trouble.

Much better off using a tool that was designed for this purpose like ruby-build or


Seems to be consensus that this is a WONTFIX, sorry.

@xu-cheng xu-cheng locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.