This is one of those short articles that I post only when Google fails to turn up any useful information and I hope my solution will be helpful to others. If you are using the acts_as_taggable plugin in an older Rails project that you've recently come back to upgrade to Rails 2, you may find that you get an error like this one: NameError (undefined local variable or method `acts_as_taggable' for ...
I honestly don't know what changed, possibly the updates that were made to auto-loading constants (which I never really bothered to learn about), or maybe the difference is in my rubygems version. I'm not sure. Anyway, if you're seeing it, you can try putting this below your gem statement: require 'taggable'.
That fixed it for me, using Rails 2.0.2 and the acts_as_taggable gem version 2.0.2.
I have been afraid of admitting that I miss my IntelliJ for a long time now. I'm coming out of the closet today. I know some people will think of me differently now, possibly shunning me in favor of people who think vim + screen = bliss. I'm willing to take that risk. You see, I've found NetBeans with the jVi plugin, and I'm happy again.
Ok, weird coming-out jokes aside, I must say that I've been meaning to write about this for a long time. But I could not find an IDE I liked, and I could not bring myself to write a post about how there are no good Rails IDEs and I hate my life because of it. How dark. Only Satan-worshipping Finnish-metal-band-listening grandma's-basement programmers would have found any joy in reading that crap.
So I postponed writing about it until today. A happy day. Because I have found NetBeans.
Why do I like NetBeans? Well, first let me tell you a little about my long journey through the valley of the shadow of IDE.
I started out with Komodo because I like ActiveState (as a former TCL/Tk person, I will always appreciate their work on that language). I was impressed. For a cross-platform IDE, it was probably the fastest I had encountered on Mac when I tried it (probably about six months ago). But at that point, debugging was too slow. It took me over five minutes to start up webrick or mongrel and reach one breakpoint. Sorry ActiveState, I was using a G4 PowerBook. Debugging would probably be much faster on my MacbookPro. I appreciated the built-in VI keystroke emulation, but I found it lacking in some small ways that nevertheless irked me.
Next I tried RadRails, which had become the Aptana Studio or something like that by the time I got around to trying it. After downloading and installing it, I gave it about five minutes of a chance before moving on. If I recall correctly, the VI integration was a shareware (i.e. not free) plugin, and the Rails support felt too much like a simple Eclipse plugin rather than a core part of the IDE. I think if I had been an Eclipse user originally (as opposed to an IntelliJ user), I might have been ok with RadRails.
Next came Borland's chance: 3rdRail. I really got excited about this for a few minutes. Actually, it was a few hours. But then things broke. There were lockups and the occasional crash, and some of the navigation features seemed to have kinks that were not yet worked out. Granted, I was using one of the very first trial releases, but I sure was not going to make the $400 bet on a license that they would fix these bugs quickly enough for me.
I moved on to my favorite ol' mule of days gone by. IntelliJ: the pride of Czech Republic. I had read about their Ruby plugin a while back and thought it might be nice to try. The IDEAVim plugin had served me nicely in the past, so I knew I could have my VI keybindings easily enough. However, when I tried to install the Ruby plugin, I needed a newer version. The newer version ran slowly on my MacBook Pro, and it was going to cost me an upgrade fee to use it once the trial ran out. I tried the Ruby plugin anyway (with the trial version), and it worked all right. I was able to run my code in IntelliJ, although I didn't get around to debugging it. My main objection was that the plugin felt too much like a plugin. I couldn't forget that I was using a Java IDE to write Ruby code. Besides, I didn't want to spend the $100+ to upgrade to the newer version when it seemed like just yesterday I had spent $250 for a professional license.
I gave up for a while after trying all of these. I resigned myself to the possibility that I might always be debugging my Rails projects with "puts" and logger.error. Then my officemate mentioned a new NetBeans release. I was skeptical, but so brimming over with cynicism about Rails and TextMate that I gave it a try. I was desperate for something to come to my rescue.
I haven't looked back since. There were so many things I instantly loved about it:
- The error detection and suggestion saved me time immediately.
- The debugging actually worked and was quick!
- I could easily control the scope of Find In Project.
- Many of the shorcut keys were so similar to TextMate that I had them memorized before lunch.
- The jVi plugin worked well and had the most complete vim emulation of any I've encountered so far.
- The Subversion support was nearly perfect.
- The code completion and popup documentation were snappy and easy to use.
- Built-in plugin management and generator wizards meant less time typing commands in a console window.
There is certainly room for improvement: Java looks stupid on the Mac (I tried the substance plugin but found it uglier in most configurations); it is not as fast as a native app would be; the Go To File functionality could be quicker (and allow for spelling mistakes); it would be nice to be able to run script/console inside the IDE. But for now, the pros completely outweigh the cons. For something like my GPX gem, where unit tests are important and I have no "Shift-Reload" concept for seeing if something is working (as in Rails projects), it is proving to be indispensable.
Elly has been making clothes faster than a five-year-old in a Nike sweatshop lately, even selling some of her stuff to her online friends. Like the wonderful supportive husband I am, I offered to take Tova off her hands one Friday when a deadline was looming especially large.
Tova and I are like the Steve and Bindi of our little universe, except that I don't hump alligators on TV and she doesn't sing weird rap songs about saving the planet. What I mean is, we like to spend every spare minute outdoors in pursuit of some sort of animal encounter. Since poking cats through the cages at PetSmart has lost its allure, we have had to resort to longer and more serious treks. For instance, we spent an entire Sunday afternoon at the Sawhill ponds looking for fox or coyote tracks in the snow. And this past autumn, we lost some pink Barbie sunglasses wading in the Big Thompson in pursuit of rising trout (I've since learned to lash important articles to the kid-carrier with 3x tippet at least).
This time, we resolved to make our Rocky Mountain National Park pass pay for itself by visiting the park for the second time this year. That's right, two times in the park more than seven days apart, and your annual pass has paid for itself. So we got in the car and made the hour drive to the park with some Trentemoller blasting (she likes it more than I do). I had too much coffee and had to stop at the park entrance to use the facilities. Of course, this means an obligatory stop at the park gift shop to squeeze all of the noise-making stuffed birds and read all the books with pictures in them. I was lucky to get out of there with only a bugling elk for $7.
Back in the car, entering the park, just as I was beginning to regret my purchase (as the 37th bugle in as many seconds rang out from the backseat), we came upon three different news vans parked along the side of the road. I pulled over to see what was going on, and across the meadow there was a group of people, some with news cameras, surrounding a few people kneeling in the grass.
Of course we got out, and I asked a fellow onlooker what we were looking at. "They've got an elk down there, and they're asking that everyone be really quiet."
The $7 bugling elk would have to remain in the car, but Tova and I hurried out join the group in the meadow. Sure enough, as we got closer, we saw that they had an adult cow elk tranquilized in the middle of a semi-circle of news people and park officials. One of the biologists held the cow's head up and kept a blindfold around its eyes while two others took samples from all over (Tova asked, "What is he doing to its butt?"). There were injections being made and syringes of blood being drawn. We had no idea what was going on until a news cameraman approached us.
"Do you know what they're doing here?" he asked, pointing the camera directly at us. I mumbled something about having no clue and how we just drove up and walked over. He informed us that they were testing for chronic wasting disease and also trying out a new contraceptive that might help in controlling the herd sizes. I said something about that being cool and interesting, and hoped that no other camera-people would approach me.
Just then another camera guy asked for an interview (I guess, as one of the few tourists there we were great candidates for that evening's soundbyte). I said sure and walked a few feeet away from the elk-watchers so that I could babble at the news camera without disturbing the Animal Planet moment that was taking place a few feet away.
If you've never been interviewed by a news cameraman, let me tell you, it is strange. Fortunately, I was confused and boring enough not to make it on the news that evening, but I worried all day that my fifteen minutes of fame would be nothing more than me Mr. Magoo-ing it about how seeing the elk was cool and neat and Gee Whiz! Cool Story Doug Fales.
Tova and I watched for a few more minutes until she was shaking from the cold, and then they let the elk go. We backed away as she stood up, started to trot, stopped, and then turned toward the herd and ran to join it. It was really very cool.
We ran back to the car to get warm and go to McDonald's, where I called everyone I could think of to tell them what we had just seen. I was lucky to have Elly's camera, so I got some great shots.
Here it is on the local news: http://cbs4denver.com/video/?id=38216@kcnc.dayport.com.
