Open tykonu opened 10 hours ago
Hey!
Testing out jruby on an existing MRI app (postgresql).
jruby 9.4.9.0 (3.1.4) 2024-11-04 547c6b150e OpenJDK 64-Bit Server VM 17.0.2+8 on 17.0.2+8 +jit [x86_64-darwin]
Localhost launches fine, but when opening it in the browser it seems that something is going wrong with the DB connection:
NoMethodError (undefined method `database_product' for nil:NilClass):
activerecord-jdbc-adapter-70.2 (java) lib/arjdbc/postgresql/adapter.rb:56:in redshift?' activerecord-jdbc-adapter-70.2 (java) lib/arjdbc/postgresql/adapter.rb:509:inclient_min_messages=' activerecord-jdbc-adapter-70.2 (java) lib/arjdbc/postgresql/adapter.rb:76:in configure_connection' arjdbc/jdbc/RubyJdbcConnection.java:596:inconfigure_connection' activerecord-jdbc-adapter-70.2 (java) lib/arjdbc/abstract/core.rb:25:in initialize' activerecord-jdbc-adapter-70.2 (java) lib/arjdbc/abstract/statement_cache.rb:23:ininitialize' activerecord-jdbc-adapter-70.2 (java) lib/arjdbc/postgresql/adapter.rb:769:in initialize' org/jruby/RubyClass.java:949:innew'
redshift?' activerecord-jdbc-adapter-70.2 (java) lib/arjdbc/postgresql/adapter.rb:509:in
configure_connection' arjdbc/jdbc/RubyJdbcConnection.java:596:in
initialize' activerecord-jdbc-adapter-70.2 (java) lib/arjdbc/abstract/statement_cache.rb:23:in
initialize' org/jruby/RubyClass.java:949:in
Extracted source around line #56:
if ( redshift = config[:redshift] ).nil? redshift = !! (@connection.database_product || '').index('Redshift') end redshift
end
Standard database.yml, works well on MRI.
Thanks for the report! Is your Rails app also Rails 7.0? The latest ARJDBC adapters currently released are for 7.0 and probably won't work on a Rails 7.1 or higher app.
Hey!
Testing out jruby on an existing MRI app (postgresql).
jruby 9.4.9.0 (3.1.4) 2024-11-04 547c6b150e OpenJDK 64-Bit Server VM 17.0.2+8 on 17.0.2+8 +jit [x86_64-darwin]
Localhost launches fine, but when opening it in the browser it seems that something is going wrong with the DB connection:
NoMethodError (undefined method `database_product' for nil:NilClass):
activerecord-jdbc-adapter-70.2 (java) lib/arjdbc/postgresql/adapter.rb:56:in
redshift?' activerecord-jdbc-adapter-70.2 (java) lib/arjdbc/postgresql/adapter.rb:509:in
client_min_messages=' activerecord-jdbc-adapter-70.2 (java) lib/arjdbc/postgresql/adapter.rb:76:inconfigure_connection' arjdbc/jdbc/RubyJdbcConnection.java:596:in
configure_connection' activerecord-jdbc-adapter-70.2 (java) lib/arjdbc/abstract/core.rb:25:ininitialize' activerecord-jdbc-adapter-70.2 (java) lib/arjdbc/abstract/statement_cache.rb:23:in
initialize' activerecord-jdbc-adapter-70.2 (java) lib/arjdbc/postgresql/adapter.rb:769:ininitialize' org/jruby/RubyClass.java:949:in
new'Extracted source around line #56:
end
Standard database.yml, works well on MRI.