Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Homebrew vs a ruby version manager on OS X?

I have a few questions about using Ruby on an OS X 10.11 El Capitan:

  1. Do you think it is ok to modify Apple's built-in Ruby installation (as in installing or upgrading Gems), or should I install a separate ruby environment? (I had been modifying the built in one previously, but once I upgraded to El Capitan Apple undid all of my changes. I never had any problems with it before the upgrade, even when I updated the Gems that Apple included in to more recent versions. Yet I am still worried.)

I'm considering leaving Apple's built in Ruby alone and installing a separate one, leading me to my second question:

  1. Everywhere I read on the internet, people recommend using a Ruby version manager (rbenv, RVM, and the like) to install a separate Ruby environment. I feel like it would be easier, cleaner, and more straightforward to simply use homebrew, since I use it already, to install a ruby to /usr/local. What would be some problems with using homebrew instead of a dedicated Ruby version manager? What are the advantages of using a version manager over homebrew?
like image 833
Joshua French Avatar asked Mar 14 '23 09:03

Joshua French


2 Answers

Don't mess w/your system Ruby, your system needs to be stable and it's not necessary.

Homebrew isn't made to manage multiple versions of software. RVM (and others) and made to do exactly that. I currently have 6 rubies installed. I'd hate to have to manage that manually. RVM (or friends) is the way to go if you are installing Ruby on your host. People often go to the next level and use Vagrant instances to further isolate their development environment.

like image 189
Nick Veys Avatar answered Mar 16 '23 22:03

Nick Veys


IMHO the most important reason to use a version manager is to be able to run multiple different versions of Ruby on the same machine e.g. to test gems with different versions or to run several (legacy and new) applications on the same development computer. Rbenv or RVM makes this easy, Homebrew doesn't support this...

like image 31
spickermann Avatar answered Mar 16 '23 23:03

spickermann