Tabular gem release

December 15th, 2009

There’s quite a bit of messy, “hey guys, I’m learning Ruby!” text-parsing code in Racing on Rails. Users must wrestle with a fussy and inflexible interface, and developers can’t improve the code without making more of a mess.

To my surprise, clean-up required more than just plugging in FasterCSV. While nice for parsing CSV, it doesn’t handle tabbed-delimited files well, nor does it like any data changes after parsing (my plan had been to just shove Spreadsheet-parsed data into FasterCSV, because I like FasterCVS’s API).

So, I need something more: support for tabs and Excel, data manipulation, and formatted output from a common interface. More concretely: read race results and event schedules from Excel and text files, and then massage data before saving it all with ActiveRecord. I also need to turn a list of race results into pre-formatted text.

You’d think someone would have been done this before, but my Google skills failed to find them. And, there were some decent, well-tested ideas mixed in with my lousy Ruby code.I took a whack at extracting the code into its own gem. Voila, Tabular:

Capistrano via Cron or FreeBSD Periodic

May 5th, 2009

Running Capistrano from cron or FreeBSD’s periodic can be tricky—both (wisely) limit your environment. Scripts may run just fine in a SSH session, but fail when run by cron.A couple of standard gotchas:

  • Command not found: your PATH is usually chopped down. Either explicitly set PATH to include you commands, or execute commands with their full paths.
  • No terminal. On Linux, try sudo’s -i option.

More puzzling:connection failed for: (RuntimeError: can’t get terminal parameters (Inappropriate ioctl for device))I assumed this was a tty/SSH/login session problem. Turns out it was a permissions problem. The current user couldn’t login to the remote server via SSH, and the remote server was prompting for a password. Of course, it worked when running this script by hand.

Rails 2.3 Plugin Routes

March 19th, 2009

As noted here and here, Rails 2.3 will load routes from a plugin. If the plugin is considered an engine. A blank “app” directory in your plugin’s root is enough for the plugin loader.

Google Group for Racing on Rails

July 29th, 2008

There was a burst of interest in WSBA website development on their mailing list—enough to annoy a few non-coders at any rate. So Racing on Rails has its own Google Group for development. Here’s hoping it’s the tip of the volunteer Rails coder cyclist iceberg.

For those late to the party or too lazy to click the link above, Racing on Rails is the Ruby on Rails application behind several bike racing association websites like the WSBA and OBRA. It’s all open source (except for the association-specific parts), and it pretty much works OK at this point.

I’ve put a lot of time into this code in the last few years. Plenty of cool ideas abound for these sites—it would be great to have more developers to make those ideas happen.

100-Year Anniversary

May 16th, 2008

Well, not quite. But my uncle just pointed out that the original (The) Butler Press was founded 100 years ago.

We’re Hiring Another Rails Developer

February 6th, 2008

“We” means Analog Analytics. It’s fun, personally, to be hiring now instead of trying to be hired. Here’s the job description:

“Terrific opportunity for talented developer to join an exciting team helping to change the advertising industry.”

It’s a remote position — Pacific time zone strongly preferred — I’m in Portland, the CTO is in Los Angeles, and the CEO is in San Diego. There’s no home office. We deploy and develop Rails (and a little C) on OS X, Linux, and Solaris.

Light on the details? Sure. We’re not hung up on any many specific qualifications. Want to earn your salary coding in Rails? Email me at

Rails 2 upgrade: .rhtml to .html.erb Script

January 16th, 2008

This is less a post, than a note to myself, but anyway, here’s a handy script to change your view extensions while preserving Subversion history.

#! /usr/bin/env ruby
require 'pathname'
for path in Dir['app/views/**/*.rhtml']
pathname =
p `svn mv #{path}#{pathname.dirname}/#{pathname.basename.to_s.split('.').first}.html.erb`

Obscure Oracle JDBC Exception du Jour

December 6th, 2007

I ran across this exception again today, and Google didn’t anything useful until I dug in a bit. Hopefully, this will help someone else searching for UnsatisfiedLinkError and free_c_state exceptions.

Your JDBC URL syntax is wrong.

You need something like jdbc:oracle:oci:@RPTD

java.lang.UnsatisfiedLinkError: free_c_statejava.lang.UnsatisfiedLinkError: free_c_state
at oracle.jdbc.oci8.OCIDBAccess.logoff(
at oracle.jdbc.driver.OracleConnection.(
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(
at oracle.jdbc.driver.OracleDriver.connect(

undefined method `dbman’

November 18th, 2007

Upgrading to a Rails app to 2.0 and seeing this error?

undefined method `dbman' for #<ActionController::TestSession

You need to add this line to config/environments/test.rb:
config.action_controller.allow_forgery_protection = false

Obvious to you, maybe, but not to me.

Dumb Thing I Did Recently With Rails

October 30th, 2007

Turns out that dashes are not really valid hostnames in URLs. So, ‘’ is valid, but ‘’ is not.

Now, Apache virtual hosting will work with underscores just fine, as did 1.1 versions of Rails and Safari 2.0. I think IE never liked it. By “worked” and “liked,” I mean that the browser accepted cookies from the host. If the browser doesn’t accept the cookies, then Rails creates a new session for each request, and that prevents you from logging in to sites like

Safari 3 show the same behavior. In fact, with Rails 1.2, the only browser that “works” is Firefox.

Anyway, long story short: don’t use underscores in hostnames.