Homebrew's Ruby 1.9 ships with rubygems. Doing gem install ... installs files and binaries into some long-winded path. For example, bundler is installed at:

/usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/bin/bundle

I'd like to have gem automatically symlink these binaries into a common location such as /usr/local/bin so that I don't have to manually link each of these binaries. Is this possible?

link|improve this question

59% accept rate
Hey. Your acceptance rate is pretty low, don't forget to accept your answers. Regards. – Fabian Zeindl May 20 at 22:48
feedback

2 Answers

This worked for me: brewbygems

I followed the instructions on that site, and installed the 'brewbygems' gem before (re)installing my ruby gems. As far as I can tell, brewbygems extends the gem system to make it aware of Homebrew. It then takes care of symlinking in the binaries when gems are installed.

link|improve this answer
3  
Please add more information as to why this worked for you. – ChrisF Apr 18 at 16:43
I've updated my answer with more detail. Does that answer your question? – Andy Apr 25 at 15:42
feedback

I ended up adding the following lines to .bashrc

RUBY_BINDIR=`brew info ruby|grep /bin|tr -d ' '`
export PATH=$RUBY_BINDIR:$PATH

The afore-mentioned brewbygems is not what you want, it's meant for the osx-builtin ruby and homebrew to play nice together, not if you installed ruby itself via homebrew.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.