This post is part of my series on Clean Lion install for Ruby Development.
Next we’ll set up our fresh dev enviroment for Ruby. Here we’ll cover installing and setting up:
- GCC (or Xcode)
- Ruby 1.9.3
- MySQL & Unix set-up
Install the latest version of Xcode, or if you don’t want to, see here for other options. Once Xcode has installed, open it, then go to preferences > downloads, and install command line tools.
In the terminal copy and paste the following:
Rbenv, Ruby-build, Ruby 1.9.3, Rubygems, Rails, Git, ImageMagick
brew install rbenv
brew install ruby-build
Then for Ruby and Rubygems:
(It may take a while installing Ruby)
rbenv global 1.9.3-p194
gem update --system
Note that ‘rbenv rehash’ has to be run each time you install a new Ruby. Rbenv global sets the global Ruby. Open up .bash_profile in a text editor and if the following lines are not present, add them:
eval "$(rbenv init -)"
Now for Rails:
Then ImageMagick and Git:
brew install git
Restart terminal and check your versions by:
And you should be all ready to go. Check out the full install guides here.
Then when you need to create sym links for your apps:
If you need it, and haven’t installed it in the first step of this post, simply download and install from the app store.
MySQL & Unix set-up
I’ve put this in a separate post: How to install MySQL on Lion
Why not give PostgreSQL a try? Most Rails devs now seem to be using it, you can find install instructions and options here: How to install PostgreSQL on Mac OS XTags: clean lion install for ruby dev, Lion, rails, ruby