Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Installing packages without linking #18971

Closed
also opened this Issue · 5 comments

5 participants

@also

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 http://superuser.com/questions/563484/installing-homebrew-packages-without-linking/577709)

@mikemcquaid
Owner

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.

@samueljohn

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
Collaborator

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.

@jacknagel
Owner

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 https://github.com/postmodern/ruby-install.

@mikemcquaid
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.