Coby Chapple

Designer, developer, entrepreneur, and (apparently) a blogger.

Ruby Development Stack Guide Roundup

With the release of OS X Lion, a number of web developers seem to be facing fresh installs, and it appears many are taking the opportunity to re-evaluate their development stack. Recently, I’ve noticed a number of posts and tutorials floating around on the topic of how to set up a fresh development stack for web app development, mostly aimed at Ruby on Rails developers. I thought I’d pull a few of these resources together, mostly for my own reference, but also in the hope it might help others out when faced with a blank install. It’s also interesting to note how some of the more common tools people use in their stack are changing—one example being the shift from using RVM to rbenv for Ruby version managment, which I’ll talk about too.

Guides

Here’s a few of the guides and write-ups I’ve come across recently.

Emerging trends

While reading through the above guides, there’s a few trends you’ll probably notice in the tools people seem to be chosing. Here’s a few of the things I’ve noticed.

Homebrew

Mac users are taking up Homebrew left, right, and center—and rightly so. In case you haven’t heard, Homebrew is a solution to package management for Mac OS X far superior to MacPorts and Fink. If you aren’t using it, you’re losing out.

OSX GCC installer instead of Xcode.

Kennet Reitz has created a standalone OSX GCC installer as a solution to the problem of having to install Xcode just to get the compilers on your system. This saves a massive amount of money, time and effort for anyone who needs to compile software, but doesn’t need or want to pay for and download Xcode. I haven’t used this myself yet, as I’ve got Xcode 4 on my system, but the project looks like a great solution to a problem many people face.

rbenv and ruby-build instead of RVM.

Sam Stephenson from 37signals created rbenv as an alternative to RVM for managing different versions of Ruby on one system. It provides the same sandboxing functionality as RVM, but is far less complex, obtrusive, and doesn’t override core system commands like RVM does. Sam also has another project called ruby-build, which makes it easy to download, compile, and install different versions of ruby. When these two tools are used together, they feel much more intuitive than RVM.

To me, RVM feels like a tool people use just because that’s what people have used in the past, and I think that is a silly reason to use anything. I’ve been using the rbenv/ruby-build configuration instead of RVM for a while now, and while I’m not a hardcore user of all the functionality they provide, I really do appreciate the simlicity of the tools. Heaps of people still use RVM, and there’s clearly a good community around that tool, but my prediction is more and more people will start switching to rbenv before long.

Pow

Pow is a brilliant lightweight Rack server created by 37signals, which can be up and running very quickly. It lets you run all your development applications at their own .dev url (e.g. http://testapp.dev/), with indpendant worker processes letting you server multiple apps simultaneously without running rails server. It’s just a simple one-liner to install, too, which is always attractive. It seems to be the development server of choice for many developers, so it’s definitely worth a look if you haven’t seen it yet.

Zsh and oh-my-zsh

OS X uses bash as the default shell, but also comes with zsh installed and available as an alternative. Zsh can be a bit confusing (I haven’t really taken the time to get my head around it), but to get up and running quickly I’d recommend checking out oh-my-zsh, a zsh distribution put together by Robby Russell, that comes with a whole bunch of great plugins, themes, and helpful scripts to make it easy to get started using zsh. While not necessarily part of the development stack, I’m noticing quite a few developers mentioning that they use zsh as their shell of choice.

Tools and scripts

In addition to the guides, I’ve also come across a couple of interesting projects which aim to help automate the process of getting a development stack up and running without fuss.

Thoughtbot’s Laptop Script

As I mentioned before, Thoughtbot have put together some scripts on GitHub which aim to automate the process of installing a Ruby/Rails focused development environment on either a Mac or Ubuntu laptop. Here’s what the script installs on a Mac (quoted from Dan Croak’s guide above):

  • Homebrew (for managing operating system libraries)
  • Postgres (for storing relational data)
  • Redis (for storing key-value data)
  • Ack (for finding things in files)
  • Tmux (for saving project state and switching between projects)
  • ImageMagick (for cropping and resizing images)
  • RVM (for managing versions of the Ruby programming language)
  • Ruby 1.9.2 stable (for writing general-purpose code)
  • Bundler gem (for managing Ruby libraries)
  • Rails gem (for writing web applications)
  • Heroku gem (for interacting with the Heroku API)
  • Taps gem (for pushing and pulling SQL databases between environments)
  • Postgres gem (for making Ruby talk to SQL databases)

Thoughtbot use these scripts at their workshops to help people get set up en-masse, so while the stack it includes is very specific, and may not be what everyone is after, it’s clearly battle tested. When I get time, I’d like to create a fork of this which uses rbenv/ruby-build instead of RVM, and a few other tweaks I have in mind.

Cinderella

Cinderella, by Corey Donohoe is a “fully managed development environment for open source hacking on Mac OSX”. It uses a combination of Homebrew and Chef to give you:

  • MySQL, PostgreSQL, Redis, Solr, memcached and MongoDB
  • Ruby (via rbenv).
  • Python with pip.
  • Node.js with npm.
  • Erlang.

I haven’t used it myself, but it seems like a very simple, straight-forward way to get a functional stack installed. Also, this is obviously better if you’re looking for a Python, Node.js, or Erlang stack, as the Thoughtbot script above doesn’t include any of those technologies.

Summary

If you haven’t thought about your development stack for a while, there are so many great new tools around that you’d be silly not to consider having a look at what your options are. I plan on eventually putting together my own laptop script (probably as a fork of thoughtbot’s ones) for use in future upgrades, but for now all the tools seem to be pretty painless to install on their own, or using tools like Homebrew. I’d say the tools and stacks available are only going to get better with time—which is really exciting, because they’re great already.

Comments