Nonexistent jdbcpostgresql adapter?

I am getting an error in my Rails project.

THe situation is that I have moved to a new computer; all worked fine on
the old, but fails on the new. It happens when trying to build the
database, and I get this error:

database configuration specifies nonexistent jdbcpostgresql adapter

As you can see I am using JRuby with PostgreSQL. I am on Rails 3.2.11,
which is a step up from what I was using before, 3.2.2, think, so this
could be the problem.

From my gemfile:

gem ‘postgresql’, :platform => :ruby

platforms :jruby do
gem ‘jruby-openssl’
gem ‘activerecord-jdbcpostgresql-adapter’
end

I have done “bundle install” and “bundle update” and “bundle exec”, and
these report back:

Using activerecord (3.2.11)
Using activerecord-jdbc-adapter (1.2.5)
Using jdbc-postgres (9.2.1002)
Using activerecord-jdbcpostgresql-adapter (1.2.5)
Using activeresource (3.2.11)

… but otherwise no help. I have also tried “gem install
activerecord-jdbcpostgresql-adapter”, which happily completes, but does
not help.

My database.yml looks like this:

login: &login
adapter: jdbcpostgresql
encoding: unicode
host: localhost
username: postgres
password: password

development:
<<: *login
database: f2db_dev

test:
<<: *login
database: f2db_test

production:
<<: *login
database: f2db

As an experiment, I tried changing the adapter name in database.yml, and
that generates a very different error:

Please install the jdbcpostgresql2 adapter: gem install activerecord-jdbcpostgresql2-adapter (no such file to load –
active_record/connection_adapters/jdbcpostgresql2_adapter)

This makes me think that it can find the adapter (when I give it the
right name), so why does it think it does not exist?

Any advise appreciated.

Just my 5 cents: I am having as well some troubles with ar-jdbc 1.2.5
and
had to switch back to 1.2.2.1 to get my scenarios working again.

Andy -

This is a bug and will hopefully be fixed soon. Jim W. in an
earlier message reported that he worked around it by specifying an older
version, 1.2.2.1, of activerecord-jdbc-adapter. This is what I now have
in my Gemfile:

gem ‘activerecord-jdbc-adapter’, ‘= 1.2.2.1’

By the way, in case anyone ever wants to access the archives of this
list, they can be found at
Search results for list:org.codehaus.jruby - MarkMail. I never remember
this, so I google ‘markmail jruby user’, select the codehaus.org link
result, and then click the
Search results for list:org.codehaus.jruby - MarkMail link at the bottom of
the page.

  • Keith

Keith R. Bennett