Forum: Ruby on Rails Postgres adapter misconfigured on Linux?

715f0bdf3441c6d0aaaaad08572d0d81?d=identicon&s=25 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
box.
 It seems like I may have the wrong/outdated packages.   I'm running
Ubuntu
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,
postgresql-contrib-9.1.


Here's the full error message:

==  AddIndexToEvents: migrating
715f0bdf3441c6d0aaaaad08572d0d81?d=identicon&s=25 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.
Removing
that gem fixed the failures.
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.