I’m using JRuby 1.7.1 with a Rails 3.2.9 application. The application
Java code in a JAR file which is loaded via a ‘require’ statement.
When I execute some JRuby code that uses the Java classes in the rails
console things work fine. However, when I execute that same JRuby code
a Rails controller action running with “rails s” I get an error related
trying to dynamically load an HSQLDB JDBC driver.
The relevant portion of the stacktrace:
Cannot create JDBC driver of class ‘’ for connect URL
java.sql.SQLException: No suitable driver
Looking at the DriverManager.java source it seems that this could be a
ClassLoader issue, but I’m unsure as to what the differences are in the
Java environment when executing this code in the rails console versus
rails server (which is using the Puma webserver) which might cause this
Can anyone enlighten me on this or point me to some docs that describe
differences between console and server? Any suggestions for
troubleshooting would be much appreciated as well.