Today as I was Googling for the solution to a problem I had with DataMapper connecting to MySQL on OS X I came across a blog post from someone who recommended uninstalling all your gems and system MySQL and then reinstalling everything with
sudo gem install. NEVER EVER DO THAT! Not unless you never intend to use Ruby or Rubygems for anything but a very few system scripts. Here’s why…
If you had talked to me a couple of years ago I might have gone along with the advice from that post. Now that I have some experience under my belt I can confidently spot bad advice even when I’m looking for answers myself.
Whatever your system Ruby is, leave it alone. You really don’t need it. If you’re going to do anything Ruby related get RVM or rbenv to manage your Rubies and dependencies.
The thing about Ruby is that you may want to develop applications in more than one version of Ruby. And even if you don’t, you’ll eventually run across a gem that requires a different version of Ruby than your default. And even if you never encounter that, it’s almost a certainty that you’ll develop applications that rely on certain versions of Rubygems or have incompatibilities with other Rubygems so you’ll definitely be needing the gemset facilities that programs like RVM and rbenv offer you.
Using the version of Ruby that comes with your system or installing the one your package manager recommends is a sure way to end up with a terminal full of stack traces from cryptic error messages. Don’t even upgrade your system Ruby. Leave it alone and use a Ruby version manager for everything. It’ll make your life much simpler.
If you haven’t heard…
I developed an iOS app. It’s amazing. Version 1.1 was just released on the App Store today. Go and get yourself a copy.