Question

I am using:

  1. Ubuntu 12.04 LTC
  2. JRuby 1.7.2
  3. Rails 3.2.12
  4. DB2 C express 10.1

My database.yml file looks like this:

development:
  adapter: jdbc
  driver: com.ibm.db2.jcc.DB2Driver
  url: localhost:50001/devdb
  host: localhost
  port: 50001
  database: devdb
  username: db2inst1
  password: mypass

But in when I stats my server and open the home page "localhost:3000/" and click on "About your application’s environment" I get the following error:

cannot load Java class com.ibm.db2.jcc.DB2Driver

Could you advice?

The only thing that I have found as suggestion was to add the driver in my JRUBY_HOME/bin/ folder but this do not solve my issue.

Was it helpful?

Solution

Copy db2jcc.jar and db2jcc_license_cu.jar to jruby/lib directory.

You are getting that error because you need the DB2 Universal JDBC driver jars in your classpath

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top