Forum: Ruby on Rails Postgres adapter misconfigured on Linux?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Benjamin Nash (Guest)
on 2013-07-24 07:13
(Received via mailing list)
I've written a simple Rails migration that adds an index to an existing
Postgres table:

class AddIndexToEvents < ActiveRecord::Migration
>   def change
>     add_index :sf_events, :account_id
>   end
> end

However, when I run the migration, it fails due to a syntax error on the
CREATE INDEX line.  I'm expecting some SQL like this to be generated:

CREATE INDEX index_sf_events_on_account_id ON sf_events (account_id);

But instead I get something like this:

CREATE INDEX index_sf_events_on_account_id ON sf_events  ( );

The migration works fine on my friend's Mac, but it fails on my Linux
 It seems like I may have the wrong/outdated packages.   I'm running
12.10 and have these packages installed: libpq-dev, libpq5, postgresql,
postgresql-9.1, postgresql-client-9.1,
postgresql-client-common, postgresql-common, postgresql-contrib,

Here's the full error message:

==  AddIndexToEvents: migrating
Benjamin Nash (Guest)
on 2013-07-24 18:23
(Received via mailing list)
No Postgres adapter was broken.  It turns out that another developer had
installed the postgres_ext gem, which doesn't support add_index.
that gem fixed the failures.
This topic is locked and can not be replied to.