Setting Up a Ruby Development Machine From Scratch With OS X Lion
Every so often I like to completely wipe out my computer and start it over from scratch. This isn't because I particularly enjoy the pain of setting up a system from scratch, but it does come with some advantages:
- You get rid of the stuff you didn't need.
- You have a chance to try things that came out since you last reinstalled.
- You have a clean install that isn't choking from years of cruft.
I took it upon myself to perform this task when I upgraded to OS X Lion and thought it would also be a great chance to write one of those "how to get a Ruby development machine going from scratch" posts since that's what I'd be doing anyway. So here's the process of how I got my machine set back up to work the way I want it to on Apple's latest.
|Google Chrome has been my browser of choice for the past year or so. I never would have thought I could give up Firebug, but the speed difference was enough for me to learn to love the Web Inspector.|
|iTerm2 is new to my roster. I don’t know too much about it other than that it can do split-pane views which is something I love in all of my apps.|
|XCode is a big huge download, and while I don’t use the IDE I need the build tools for just about everything else in my dev toolchain.|
|Adium is my universal IM client of choice. It’s simple, customizable, and always there when I need it. I roll with the AdiumIcon icon set, the Mnmlsm message style, and the Leopard Sidebar contact list style.|
|Mailplane gives me exactly what I want in an email client: the GMail web interface but in its own dedicated application. While the benefits over something like a Fluid window for GMail aren’t necessarily enormous, email is core enough to my daily routine that it was worth a little cash for a little better experience.|
|MacVim is my editor of choice although I don’t pretend to be a “real” Vim user. I switched to Vim *solely* because it allows me to edit with split pane windows, and I still treat it more like Textmate than I’d normally like to admit in public. Note: If you’re planning to use ZSH you’ll want to install a snapshot release of MacVim, otherwise it will occasionally hang.|
|Growl is an obvious must-have for any Mac user, developer or not.|
|Presently and HipChat are my desktop coworker communication tools and I’d be lost without them.|
|Alfred is another new addition to my roster, replacing the Google Quick Search Box. I haven’t used it much yet, but I had heard good things so I’m going to give it a go.|
|VLC has a well-deserved reputation for being able to play just about everything. If I could remove Quicktime entirely and replace it with VLC, I would.|
|Spotify is what I’ve been using the last week or two. I’ve tried both it and Rdio and I’m honestly pretty torn as to which I like more. But let’s be honest, my primary listening point for music recently has been Turntable.fm.|
|The Official Twitter App is the client I’ve used since its release. I’m not a power user (and all of the searches that I care about I handle via Twilert so it works well enough.|
|Cloud is an extremely useful little app to have for quickly sharing screenshots and files. I use Skitch as well when I need to be able to annotate the shots quickly.|
|Adobe CS5 gives me the tools that I need for putting together logos and design assets. I was going to say “and mocking up sites” but since CSS3 I don’t really use Photoshop for mockups that often these days, I just go straight for the markup.|
Command Line Commando
Once I had gotten the easy stuff out of the way, it was time to actually set up all of the development tools that I would need to get my machine up and running the way I needed it.
First up is installing Homebrew. Homebrew is without a doubt the simplest and most "it just works" package manager that I've used for OS X. Installing it is as easy as:
/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"
Once Homebrew is installed, we can go on a mad tear of package installation. Here are some of the tools that I set up right away:
brew install wget git redis node imagemagick brew install postgresql brew install mongodb
Another new entry for this round, I thought I'd take my coworkers advice and switch to ZSH with Oh My ZSH. Installed like so:
wget --no-check-certificate https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh
Next up we'll install RVM so that we can manage multiple Rubies with ease. I'll also be installing the Rubies that I use on a regular basis and setting the default Ruby to be 1.9.2 since that's what I'm using 90% of the time.
bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer ) rvm install 1.9.2 rvm install jruby rvm use 1.9.2 --default
After that I needed to follow the instructions printed out by RVM to make sure it was working in my shell. Magnificent! Now we're almost all done with our basic development stack. We need something to run our web apps, and Pow is definitely my favorite nowadays. We'll also install the powder gem to make it super simple to manage our Pow links.
curl get.pow.cx | sh gem install powder
Now I've got my development tools up and running, but I still need a little bit more out of my editor. Like I said, I'm a training wheels Vim user, so I like to install Yehuda/Carl's janus to get a good set of Vim plugins that make Rails development super easy in MacVim.
curl https://raw.github.com/carlhuda/janus/master/bootstrap.sh -o - | sh
We're getting quite close now. The only thing to do before enjoying my new setup is to make it so that I can clone my repositories off of the various services I use. So I followed the GitHub, Unfuddle, and Heroku setup instructions and I was up and running.
So that's pretty much it! Everything went pretty much as expected once I actually got a fresh-drive install of Lion working. The biggest pain was waiting for multi-gigabyte downloads like XCode, but leaving them overnight worked well enough to solve that. So for those who are curious, Ruby development is alive and working on Mac OS X Lion. Is there anything in my setup that you'd do differently? Let me know in the comments!