Ruby Environment Setup for Beginners – OSX

 In Clutch Team, Thoughts

uweo7

(This image taken from rubyweekly.com who in turn took it from xkcd and adapted it for their own nefarious purposes)

I’m very excited to be working on my very first OSX machine ever. Do I love Apple business practices? No. Do I like their hardware? Hell yeah.

So, onto setting up a Ruby Environment! This guide is a great way to get started, and definitely helped me get started.

1. Open Terminal

2.Install xcode (see my previous Python setup post for how to do this)

3. Install homebrew. the missing package manager for OSX (see Python setup post for this as well)

4. Install RVM (Ruby Version Manager).

Run:

echo "gem: --no-document" >> ~/.gemrc

  • WHY? This is the configuration that allows you to install gems without automatically installing huge amounts of offline documentation

Run:

curl -L https://get.rvm.io | bash -s stable --auto-dotfiles --autolibs=enable --rails

  • This is where bash stuff gets a little more complex!
  • curl is a program that makes web requests and returns the result
  • -L means we’re logging the result of the get request (sent by curl to the get.rvm.io address) to the console
  • | is the pipe. what we’re saying pass the stuff at the left of the pipe that is logged to the console to whatever is in the right of the pipe
  • The --rails at the end tells the rvm script to install the latest version of rails
  • Essentially, we’re downloading the rvm install script (which handles ruby installation for you) using curl and running it using bash

5. Once that’s done (you’ll see a stream of “successfully installed…”) close out of Terminal and reopen it.

6. Type in rvm and you’ll see a bunch of joyously green text which confirms that rvm is installed – yay!

7. Type in ‘rails -v’ to verify your rails version, or ‘ruby -v’ to verify your ruby version

AND WE’RE DONE!

Recent Posts
Contact Us

What can we do for you?

Not readable? Change text. captcha txt

Start typing and press Enter to search