Install Ruby on OS X 10.10 Yosemite (Using RVM)

This is a quick guide for installing the latest version of Ruby on OS X 10.10 Yosemite using RVM.

If you are installing Ruby on a clean install of OS X, you might need to install Apple’s command line tools. You will either have to do this manually with the link I provided, or your system might prompt you at some point to install it for you. Either way, it shouldn’t be a problem.

First we need to install RVM:

RVM is the ‘Ruby Version Manager’. It makes installing Ruby (and Rails) a breeze. There is other version managers for Ruby out there, but this is the one I’ve always used, and the one i’m comfortable with.

Copy the following line into your terminal and press enter:

Screen Shot 2014-08-27 at 09.47.52

You should see this when it’s done. If you get any warnings, you are best off using google for that, as there can be many reason for them. On a fresh install of OS X you shouldn’t get any though…

Pay attention to this line:

This is telling you, that in order to start using RVM, you need to tell your current shell it has been installed. This is either done by running the

command in the current terminal window, or simply by closing all terminal windows and opening them up again.

Do whichever you prefer.

Now try and run  rvm -v .

Depending on when you are reading this (the version number might have changed), the output should be similar to this:

Screen Shot 2014-08-27 at 09.52.13

Cool, that means that RVM is now installed.

On to installing Ruby… Run the following line in your terminal

You should now be prompted to install ‘Homebrew‘. Homebrew is a package manager for OS X. Think of it as the OS X App Store for geeks. Go over to their website and have a look around. There is a lot of cool stuff there…

Screen Shot 2014-08-27 at 09.57.12

First it asks you if you are ok with installing Homebrew in the default directory. I suggest you just press ‘enter’ and let it do it’s thing…

Screen Shot 2014-08-27 at 09.59.47

 

After that, it will ask you if you are ok with running the following scripts. These are the scripts that will install Homebrew. Again, just press ‘enter’

It will ask you for your password, type it in and wait for the download and installation to complete.

This can take some time, so don’t be alarmed if it seems to halt on something. Mine took about ~7 mins.

Yet again it asks you for your password, this time it’s for creating a directory for the openssl module. Go ahead and type it in again…

And voila

Screen Shot 2014-08-27 at 10.44.24

 

You should see something like this… (Like the pretty colors? follow my OS X Yosemite terminal guide)

If you run

it should give you the version of ruby installed like this:

Screen Shot 2014-08-27 at 10.46.25

 

And that’s it… You are all set. Ruby is now installed, go ahead in type  irb in the terminal, and play around with Ruby.

Question: What happens if you type 1 + 2  in irb?

or gets.chomp  followed by "Don't repeat what I'm saying?"

Do you need to get started with Ruby?

AstonJ has this great guide for learning Ruby and Ruby on Rails.

If you want to get your fingers dirty quickly, go to https://rubymonk.com or http://tryruby.org/… Both are great online tutorials for learning Ruby.

Onwards and upwards as they say!

– Chris

 

19 thoughts on “Install Ruby on OS X 10.10 Yosemite (Using RVM)

    1. Ditto! Super straight forward. Easy to follow. Fixed my earlier botched attempts in a flash. Keep up the magic, Kudos!

  1. Ok, this was easy. And now, for a total Ruby noob: where to put the package i downloaded?
    I’ll explain: I downloaded SpreeCommerce, a RoR webshop. This has some options i missed in other webshops. For this package I needed RoR, which had not come to my attention before. I know that normal HTML-websites can be put in the “Website” folder of your user folder. How about the RoR packages?

  2. This is the error I receive when trying use this: rvm install ruby, appreciate any help, thank you.

    No binary rubies available for: osx/10.10/x86_64/ruby-2.2.0.
    Continuing with compilation. Please read ‘rvm help mount’ to get more information on binary rubies.
    Checking requirements for osx.
    -bash: /usr/local/bin/brew: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory
    ERROR: ‘/bin’ is not writable – it is required for Homebrew, try ‘brew doctor’ to fix it!
    Requirements installation failed with status: 1.

    1. Hi Jerry. This sounds like permission issues. Have you installed Ruby using the ‘sudo’ command? If so, you might wanna try and uninstall and redo it without the ‘sudo’ command

  3. Hi, I entered the command
    \curl -sSL https://get.rvm.io | bash -s stable
    But I get back “unable to get local issuer certificate” it advises using the -k switch but that doesn’t work either. I downloaded the gpg tool suite as advised from the RVM website. Anyone else having the same problem!

  4. thanks for the super quick “how to guide”. this really helped me. was spending so much time and finally got this installed.

    thanks again.

Leave a Reply

Your email address will not be published. Required fields are marked *