found drama

get oblique

wrestling with rails

by Rob Friesel

For various reasons, I decided to give TextMate another try (as I may be hitting Smultron‘s upper limits). One of the reasons was to because I felt like trying my hand at a few Rails tutorials and TextMate is supposed to be the de facto standard editing environment for that kind of development1 — and thus begins our chicken-and-egg question.

Anyway: day one of our TextMate evaluation period and I figure: No time to lose, better get crackin’ on a tutorial or two… In particular, I have my eye on this tutorial from over on the Apple developer site; it seemed to apply most directly to my specific aims in learning the language and appeared to take the most direct approach. A quick install of MySQL and Locomotive later and I’m ready to go…

But we don’t get very far, do we?

The instructions in the tutorial conflict with each other and make some assumptions about what you have (or have not done) with respect to setting up your $ENV and $PATH (etc.) On the one hand, they mention Locomotive by name as a “golden-path” method to get up and running and on the other, they’re linking out to the Hivelogic build tutorial. At any rate, there is a disconnect — and I’m fairly convinced it has to do with what is or isn’t in the $PATH; specifically, Rails doesn’t seem to know where to find “rubygems” and I’m pretty confident that it has to do with Locomotive and its “Bundles”. For example:

  1. The article says to set up the project on the command line using rails expenses — but it doesn’t like that. Apparently, “rails” cannot be found. But that’s no problem. Locomotive takes care of this set up on your behalf anyway.
  2. Next it says to throw script/server into the command line. I’ll admit that I skipped this one. Again: Locomotive is more than happy to do this on your behalf.
  3. Where we get into trouble is with the migration generator:
$ script/generate migration accounts
./script/../config/boot.rb:18:in `require': No such file to load -- rubygems (LoadError)
from ./script/../config/boot.rb:18
from script/generate:2:in `require'
from script/generate:2

…? Not seeing a way to do this through Locomotive, I try to work my way backwards through the code. The error message certainly gives me the right breadcrumbs. Perhaps I’m still too novice with Ruby itself to fully determine what it means. I’ve got enough experience with other languages to make a guess: just like it says, it can’t fine “rubygems” but only because that file isn’t where the script expects it to be. A quick Spotlight search for “rubygems” uncovers 21 files and 8 directories (all buried deep within that “Bundles” directory that Locomotive has installed for itself.

So why the mismatch?

At this stage, I’m not certain. Which is a drag because I was expecting a much cleaner install, a much cleaner first impression. How am I supposed to “get” the beauty of this full stack framework when the only thing it wants to do for me is choke and throw errors? Alas, we’ll call it an unsuccessful night and hang up our spurs. For now.

  1. Though their marketing literature would sure have you believe that it’s the de facto standard editor for any geek textnology on OS X. []

About Rob Friesel

Software engineer by day, science fiction writer by night. Author of The PhantomJS Cookbook and a short story in Please Do Not Remove. View all posts by Rob Friesel →

2 Responses to wrestling with rails

found_drama says:

And of course it’s something stupid like:

Locomotive: Help: “Select your application in the Locomotive main window and choose Applications > Open Terminal”

Leave a Reply

Your email address will not be published. Required fields are marked *