Locomotive: Rails for OS X

This is nifty – Locomotive, from Ryan Raaum, a complete Ruby on Rails environment in a self-contained 30MB bundle. And when I say complete, I mean complete: Locomotive contains not only Rails itself, but the Ruby interpreter, RubyGems, the LightTPD webserver with FastCGI, the SQLite database engine, bindings for MySQL and PostgreSQL (though not the server binaries, wisely), and all the other bits and pieces needed for turnkey Rails. There’s also an expanded version of the package with even more goodies. If you have an existing Rails installation, Locomotive will run politely alongside it without messing anything up.

Within 60 seconds of installing, I had a dummy Rails project created and running. Within 5 minutes, proudly, I had my first error:

./script/../config/environment.rb:48:in `require': 
    No such file to load -- rubygems (LoadError)

After poking around a bit I realized this happened because I was using the default /usr/bin/ruby rather than the bundled Ruby binary. Ryan quickly confirmed this via email, and told me that the right way to work is to access the Terminal via Locomotive’s “Open Terminal” command, which sets your paths appropriately.

Rails fans should be cheering Locomotive regardless of whether they actually use it. Anything that makes it easier to simply jump in and starting using a particular technology is going to help that technology spread faster. Sure, you might not want to use Locomotive for public deployment (though it would be tempting!), but it’s a pleasure to use and a great way to get people hooked on Rails. It will be fun to see this develop – perhaps in the direction of integrating with something like RADRails, though I realize the subject of IDEs in the Ruby/Rails community is a controversial one, as it is with Python.

If you’re using BBEdit or TextWrangler, make sure you’ve got the Ruby language module.

There’s not much in the way of documentation yet, but of course there’s a screencast!


Dustin Ground commented on Fri Jan 12 16:01:05 2007:

Thanks for posting the Open in Terminal hint. I just spent two hours debugging that same ‘require’ error.


jason commented on Sun Feb 25 12:50:57 2007:

damn, I spent a good chunk of the evening trying to fix this.

Also, if you are using radrails with locomotive, I found this that will help you get it working smoothly with your locomotive install

http://wiki.radrails.org/wiki/RadRailsUserManual


Paul commented on Sun Feb 25 16:56:48 2007:

It’s good to hear that posts like this – which I definitely make with searchers in mind – occasionally reach their target. Of course, more often than not, that target is myself six or twelve months in the future!


alex commented on Mon Feb 26 15:49:03 2007:

Ok, I must be rather stupid. I installed Locomotive and can run an application, but there is no way whatsoever to see it. When I type localhost:3000 I get an error. Apache tells me that it cannot connect to the localhost computer on that port. Of course it connects without the 3000. How do you use the LightTPD thingie?

I even configured Apache to allow cgi-bin but nothing.

Any help would be welcome.



Share: