A couple weeks ago I ran into some horrible issues with Oracle and activerecord-jdbc. Inserts were failing with an “invalid column index” error.

It turns out this was reported as JRUBY-2018 and resolved, but there wasn’t a release of activerecord-jdbc that contained the fix.

Being impatient like I am, I grabbed the head from svn and built it myself. So if you ever find you need to build yourself an activerecord-jdbc gem from subversion, here you go:

First make sure you have hoe installed.

jruby -S gem install hoe

Grab the source from svn.

svn co http://jruby-extras.rubyforge.org/svn/trunk/activerecord-jdbc

Build the .gem

jruby -S rake package

Install the generated .gem file.

jruby -S gem install activerecord-jdbc-adapter-[version].gem

MAKE SURE YOU UNINSTALL YOUR PREVIOUS VERSION

The chances that you’ll have to do this are very slim. Nick Sieger is usually super-on-top of making sure things are up and working the way they should be, but just in case.

In the process of setting up my new dev machine, I decided I was going to try using MacPorts to install all of the dev-type-software instead of installing into /usr/local.

James Duncan Davidson has a great overview article (that needs no further explaining from myself), titled Sandboxing Rails With MacPorts. Another similar article can be found here.

My problem is that I work on a lot of projects that use ImageMagick / RMagick, and that’s not discussed here.

No worries, I’ll install ‘em and give it a go:

sudo port intall ImageMagick
sudo gem install rmagick

CRAP! I don’t know what happens for you, but ImageMagick installs perfectly for me, and then RMagick craps out and dies something like this:

/opt/local/lib/ruby/gems/1.8/gems/rmagick-1.15.9/./lib/rvg/misc.rb:321:in `get_type_metrics': 
unable to read font `(null)' (Magick::ImageMagickError)
from /opt/local/lib/ruby/gems/1.8/gems/rmagick-1.15.9/./lib/rvg/misc.rb:321:in `render'
from /opt/local/lib/ruby/gems/1.8/gems/rmagick-1.15.9/./lib/rvg/misc.rb:696:in `text'

Now, for the solution I am going to give all credit to Jakob Skjerning, because I found the solution on his site after doing some Googling.

Do this instead:

sudo port install ImageMagick
sudo port install rb-rmagick

Done. Works. Thank goodness.

Capistrano Upgrade Problem

August 31, 2007

A few days ago I ran a sudo gem update and unwittingly got a Capistrano 2.0.0 upgrade that broke my ability to deploy a bunch of existing Rails apps.

cap deploy
the task `deploy' does not exist

Hmm. That sucks. Nick to the rescue. Here’s the culprit:

gem list | egrep -v "^( |$)" 
...
...
capistrano (2.0.0, 1.4.1, 1.4.0)
...
...

Needed to uninstall all the Capistrano gem versions, and install the last working one (apparently 2.0.0 is not backwards compatible with 1.4.1 – which I didn’t know until today).

Here we go:

sudo gem uninstall capistrano -v 2.0.0
sudo gem uninstall capistrano -v 1.4.1
sudo gem uninstall capistrano -v 1.4.0

Say Yes when it asks you to uninstall the cap and capify binaries.

Now let’s install 1.4.1 again:

sudo gem install capistrano -v 1.4.1

Yay! It works! Time to fix those deploy scripts… when I have time.

I wrote this article for IBM developerWorks a while back, but never ended up blogging about it. So at any rate, here it is: Ruby on Rails and XML – for better or for worse.

Singapore Ruby Brigade

April 24, 2007

Nick is here visiting from Texas, and we took the opportunity to head off to a Singapore.rb meeting last Thursday with facilities for the meetup graciously provided by the NLB. Ivan the librarian has posted a blog entry about his experience at the meetup, and seems enthusiastic in how the library might help to support the community. If you’re in Singapore and have any interest in Ruby or Rails at all, it’s time to get involved in the community – this is a great place to learn, ask questions and hang out with some really smart folks. Join the google group, or come hang out on IRC (Freenode) at #singapore.rb, I’m always so lonely by myself.

A Note On Rails Deployments

February 23, 2007

Never, ever deploy Rails on a shared server. GRRRRR! I’ll be off DreamHost as soon as I’m not too busy writing code and doing work.

A Note To Dan Benjamin

February 17, 2007

If we ever meet, I will buy you a beer, or wine, or whatever you want.

You are forever in my gratitude for how much time you save me thanks to this and this.

For the uninformed: If you need to install Ruby/Rails/Mongrel/RMagick/etc. on Mac OS X, and you don’t want to have to figure it out yourself, or think, then follow the above links.

One Week Later

November 12, 2006

At long last, after sucking most of my previous site content and blog entries from TextPattern, I’ve manage to finally deploy the new site to TextDrive now powered by SimpleLog and RoR.

I’ve previously found the documentation at TextDrive severely lacking, especially in the area of Rails application deployments, however this time around, I was pleasantly surprised by a series of articles that were a great help (along with scripts and config files) for deploying your Rails apps on Lighttpd.

Several other Rails folk I’ve spoken to have expressed concern over Lighttpd’s stability, many of whom have switched to Mongrel. I’m hoping that I don’t run into any stability issues.

Previously, I also had a nice site up for JarIndexer and XafeNotes, but alas, that is no more. I can’t bother to manage a separate site, so they’ve been included in this site for now. JarIndexer is still available for download, as it seems to be somewhat widely used, but I’ve temporarily yanked XafeNotes, as I have some intention of making it free (as in beer), and need to pull out the licensing stuff from the code base. Who knows when that will happen.

About three weeks ago, I started doing some work for Orangepath, a Texas-based company, that I’m hoping will turn into a great long-term relationship. It’s a breath of fresh air to find a company built on morally upstanding principals. I’ve actually had a ton of stuff to blog and yammer about these past weeks, but my time has been spent trying to get this site up and running, instead of writing content to bore people to death. I’ll apologize in advance if there seem to be more entries than usual in the coming days.

Simpler... Simpler...

November 05, 2006

I seem to change this site more often than actors in Hollywood change spouses. I’m also a horrible criminal in that I’m really lazy at properly setting up 301 permanent redirects when I move my site to a new layout, new blog software, new framework, or what have you (but I’m working on it, I promise!).

Lately I have found that TextPattern feels so bloated to me, and I don’t have the time or patience to figure out the stupid syntax for all it’s templates, forms, and other goop.

Nick pointed me in the direction of SimpleLog – and I totally loved it. It’s, well, simple. And it’s Ruby, easy to customize and, well, simple.

So here we are – an attempt at once again swapping a back-end in the hopes that “this time” I’ll be less fickle than in the past, but I’m not making any guarantees.