links, musings, and news

Monday, August 9, 2010

How to install Ruby Version Manager (RVM) in OSX for Ruby & Terminal Nubies PT 1

Part 1: Setting up the software ecosystem.

There are a few great tutorials out there already on installing RVM. However, many assume the user has a certain amount of software development experience, or has certain software installed. 

This step by step tutorial is specially designed for Ruby & Terminal Nubies. If you can surf the web and use your mac for day to day stuff, this tutorial is designed guide you through everything else you need to know. No software development experience required.

For those who are new to Ruby Version Manager: "RVM is a command line tool which allows us to easily install, manage and work with multiple ruby environments from interpreters to sets of gems." If that sounds like something you're into, let's get started.

To install RVM on OSX you're going to need an ecosystem of support applications including:

Mac OSX 10.6.3+
Terminal
Git
xCode Tools 3.2+
Textmate (optional but recommended)

If you have all those apps already installed, installing RVM should take about 10-15 minutes. If you DON'T have them installed, grab a cup of coffee and sit down, cause you're going to be here for a while.

In fact, if you're installing or using these apps for the first time, one of the fastest ways to multiply your productivity overall is to get familiarized with Terminal, Git, and Textmate. If you're interested in software development with Ruby, you're going to be using them again and again. 

So here we go. 

Mac OSX 10.6.3+
Click on the apple at the top left of your screen, then on "About this Mac"

You'll see a window like this one. If the gray text right under Mac OS X says Version 10.6.3 or higher, you're good to go.

Terminal
Terminal is the program you use to control your computer via the command line. If you're new to Terminal, taking a Quick Tutorial on terminal can get you more familiar with it. 
You'll need it to do a lot of the cool stuff developers do. 

If you have OSX, you've already got Terminal. Here's how you find it:

Do a spotlight search for Terminal or go to your applications/utilities folder and click on this guy:

A window should pop up that looks something like this:

Your computer may have a different name, and that's fine. The login info with the dollar sign means we're on our way. 

Check the title bar of your terminal window. If it says bash, skip to the next step: Git.

IMPORTANT: 

If it doesn't say bash somewhere in the title bar, go to terminal, preferences,  click the green Startup flag, and the Command (complete path): radio button. 

Copy and paste this in the text field:

/bin/bash

What that does, in case you're curious, is changes the default shell of your terminal app from tsch to bash. Real 1970's Unixy stuff. 
Without clicking any more radio buttons, close the window. (It's important to leave the Command (complete path): radio button active. If you click on the Defaultlogin shell radio button, it'll change the Command (complete path) field back to tsch.  It's sneaky that way.

Git

What's that? Revision control software like Git keeps track of your changes as you develop a software application. Did that new change to the code mess up your program? With a revision control system, you can "roll back" to the previous version. Think of it like "Undo" for programmers.  Git also lets you share the code with other programmers so you can make contributions as a team.

You're going to need Git. So download it here. 

Once you've downloaded the installer, which at the time of this writing looks like this:

Click on it, follow the instructions. Then come on back.

Xcode Tools version 3.2+
Because of a bug in the OSX 10.6 CD, you need to download the latest version of xcode, Apple's development environment,  and install it. This might take a while but at least it's free. 

Go to the xcode download page<LINK> on apple's website. If you're not already an Apple developer, there's an involved registration process and the download is big. While you're waiting for the download is a good opportunity to skim the rest of this tutorial and spend some time with tutorials for Git, Terminal, and Textmate.

Once Xcode is downloaded, just follow the instructions to install it. 

Textmate
Textmate is a commercial text editor, and if you plan on doing any software development, it's pretty awesome. It's also the only commercial application in this process. There's a 30 day free trial download so you can try it out gratis, and great <a href="<http://projects.serenity.de/textmate/tutorials/basics/#> online tutorials </a> to help dramatically improve your productivity.

There are other free text editors out there, but I used Textmate to install RVM so that's the one in this tutorial. 

Aaannnd...that's if for now.  Once you've installed: Mac OSX 10.6.3+, Terminal, Git, xCode Tools 3.2+, and Textmate (optional but recommended,) you're ready to install RVM. 

Stay tuned for Part 2 of "How to install Ruby Version Manager (RVM) in OSX for Ruby & Terminal Nubies" in which we actually install rvm and get started with different versions of Ruby.

Posted via email from FrancoB411

No comments: