Category Archives: Ruby

Ruby programming stuff.

Setup Ruby development environment with rvm on Mac OS X

Since I experimented with some Ruby web application stuff the last weeks, I want to share some of my conclusions how to setup a development environment which is working for my two major platforms, Mac and Linux. This post will cover the setup of an easy to use development environment on Mac OS X. I am running Mavericks but this should work on all of the latest supported Mac OS X versions as well.

First install XCode or just the command line tools.

Try if the gcc command works for you in a terminal if gcc is not installed a window appears which allows you to install the necessary packages.

Next step is to install Mac Ports

Download the latest install package for your Mac OS X version from: http://www.macports.org/install.php

Install rvm:

Now it is time to install the rvm for your user. Open a new terminal and run the following command:

\curl -sSL https://get.rvm.io | bash -s stable

This will install rvm and add all necessary stuff to your bash profile. If you are using a different shell or something does not work for you please have a look at the rvm documentation: http://rvm.io/rvm/install

The install output gives you the advice to run the source command for your user, copy it and run it in your active shell to make rvm available in this shell. The command looks something like: source /Users/<YourUsername>/.rvm/scripts/rvm

Install ruby:

For my applications I am using the ruby 2.1 version. You can install any version you want or need and rvm allows you to switch your active ruby version on the fly.

Lets start with Ruby-2.1 for now:

rvm install ruby-2.1

Activate that ruby version and make it default ruby version for now:

rvm use ruby-2.1 --default

Test it:

ruby -version

Thats it. You should now have the Ruby-2.1 version active and you can start installing gems or start your development with Ruby. If you want to switch your active Ruby version just use the rvm command and install a different version and use it.

I hope this helps you to save some time and trouble setting your development environment up.