Thursday, March 10, 2016

Setting up Ruby on Mac OSX

Mac OSX ships with a version of Ruby, but it is almost out of date. You can see the current installed version by opening a console and typing

$ ruby --version

Regardless of whether the version you see reported is current, old or if Ruby is somehow not available, you'll want to take control of your Ruby version for serious development. You are interested in controlling:

  • which Rubies are installed on your system,
  • which Ruby you happen to be using at any one time
  • which Ruby you expect your users to have to run any Ruby code you develop.
To this end you'll want to take some specific steps to get this kind of control. On OSX this is pretty easy. 

Apart from this sort of control, you'll also want to make sure you can install gems with native extensions. Gems with native extensions need to be compiled on (or for) the target system. Ruby's gem infrastructure needs access to specific system tools and native libraries to do this. 

Google picked this guide when I googled the question about how to install Ruby on Mac OSX. Bear in mind there is more than one way, but it happens this guide mostly mirrors how I have set my local environment up:

  1. Install X-code command line tools (to support native compilation)
  2. Install Homebrew (a package manager for Mac)
  3. Install RVM or RBENV (ruby version managers)
  4. Install your Ruby or Rubies of choice using RVM or RBENV
The guide linked above uses RBENV to manage ruby versions and it has a specific instructions for the entire process. My experience is only with RVM. So if I get a chance I'll investigate further the difference and possible advantages and disadvantages.


4 comments:

  1. High quality service from very economical costs Mac training! I came to San Diego Mac Repair having a broken apple iphone screen and front-facing camera and he could solve both problems in no time. He's an excellent man and that i would certainly suggest him to anyone who requirements an iPhone repair…..

    ReplyDelete
  2. Every time you stop outside that glass window showing those glittering, stunning Rolex watches. This is a heartfelt desire to wrap your wrist with this most well- known name,Svizzeri perfetti Orologi. There is good news for you. Now, you need not to spend those big bucks for acquiring your dream watch. Your answer is Replica watches. Yes come here buySvizzeri Repliche Orologi

    ReplyDelete
  3. This is one of the most important blogs that I have seen, keep it up!cash advance loans

    ReplyDelete