Forum: JRuby nonexistent jdbcpostgresql adapter?

Posted by Andy Joel (f2andy)
on 2013-01-10 16:14
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.
Posted by Keith B. (keith_b)
on 2013-01-10 18:59
(Received via mailing list)
Andy -

This is a bug and will hopefully be fixed soon. Jim Wharton 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 
http://markmail.org/search/list:org.codehaus.jruby.  I never remember 
this, so I google 'markmail jruby user', select the codehaus.org link 
result, and then click the 
http://markmail.org/search/list:org.codehaus.jruby link at the bottom of 
the page.

- Keith

---
Keith R. Bennett
http://about.me/keithrbennett
Posted by Krum Bakalsky (Guest)
on 2013-01-10 21:36
(Received via mailing list)
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.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.