I'm struggling for many hours now using activerecord-jdbcmssql-adapter with Rails 5.1 (or 5.2). I've installed ant to be able to compile the gem during the bundling. The bundle process runs fine but when I want to start rails I'm just getting
Bundler::GemRequireError: There was an error while trying to load the gem 'activerecord-jdbcmssql-adapter'.
Gem Load Error is: undefined method `type_cast_from_database' for class `ArJdbc::MSSQL::UUIDType'
I've googled a lot but didn't find a solution or a hint what causes this error. Here is some more information:
Java version: Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Ruby: jruby-9.1.17.0
OS: Win10
Part of the Gemfile
ruby '2.3.3'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.1.6'
gem 'activerecord-jdbc-adapter', github: "jruby/activerecord-jdbc-adapter", :branch => "51-stable"
gem 'activerecord-jdbcmssql-adapter',github: "jruby/activerecord-jdbc-adapter",:branch => "51-stable"
gem 'activerecord-oracle_enhanced-adapter','~> 1.8.0'
The Backtrace
Q:\Ruby\jruby-9.1.17.0\bin\jruby.exe -S rails s
Bundler::GemRequireError: There was an error while trying to load the gem 'activerecord-jdbcmssql-adapter'.
Gem Load Error is: undefined method `type_cast_from_database' for class `ArJdbc::MSSQL::UUIDType'
Backtrace for gem load error is:
org/jruby/RubyModule.java:2841:in `alias_method'
o:/bundler/bundler/gems/activerecord-jdbc-adapter-4eebab4df17d/lib/arjdbc/mssql/types.rb:319:in `<class:UUIDType>'
o:/bundler/bundler/gems/activerecord-jdbc-adapter-4eebab4df17d/lib/arjdbc/mssql/types.rb:316:in `<module:MSSQL>'
o:/bundler/bundler/gems/activerecord-jdbc-adapter-4eebab4df17d/lib/arjdbc/mssql/types.rb:2:in `<module:ArJdbc>'
o:/bundler/bundler/gems/activerecord-jdbc-adapter-4eebab4df17d/lib/arjdbc/mssql/types.rb:1:in `<main>'
org/jruby/RubyKernel.java:956:in `require'
o:/bundler/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `block in require'
o:/bundler/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:258:in `load_dependency'
o:/bundler/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `require'
o:/bundler/bundler/gems/activerecord-jdbc-adapter-4eebab4df17d/lib/arjdbc/mssql/adapter.rb:1:in `<module:(root)>'
o:/bundler/bundler/gems/activerecord-jdbc-adapter-4eebab4df17d/lib/arjdbc/mssql/adapter.rb:37:in `<module:MSSQL>'
o:/bundler/bundler/gems/activerecord-jdbc-adapter-4eebab4df17d/lib/arjdbc/mssql/adapter.rb:30:in `<main>'
org/jruby/RubyKernel.java:956:in `require'
o:/bundler/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `block in require'
o:/bundler/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:258:in `load_dependency'
o:/bundler/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `require'
o:/bundler/bundler/gems/activerecord-jdbc-adapter-4eebab4df17d/lib/arjdbc/mssql/adapter.rb:29:in `<main>'
org/jruby/RubyKernel.java:956:in `require'
o:/bundler/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `block in require'
o:/bundler/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:258:in `load_dependency'
o:/bundler/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `require'
o:/bundler/bundler/gems/activerecord-jdbc-adapter-4eebab4df17d/lib/arjdbc/mssql.rb:1:in `<main>'
org/jruby/RubyKernel.java:956:in `require'
o:/bundler/bundler/gems/activerecord-jdbc-adapter-4eebab4df17d/lib/arjdbc/mssql.rb:2:in `block in (root)'
org/jruby/RubyArray.java:1735:in `each'
o:/bundler/bundler/gems/activerecord-jdbc-adapter-4eebab4df17d/activerecord-jdbcmssql-adapter/lib/activerecord-jdbcmssql-adapter.rb:1:in `block in (root)'
org/jruby/RubyArray.java:1735:in `each'
o:/bundler/bundler/gems/activerecord-jdbc-adapter-4eebab4df17d/activerecord-jdbcmssql-adapter/lib/activerecord-jdbcmssql-adapter.rb:2:in `(root)'
Q:/Ruby/jruby-9.1.17.0/lib/ruby/gems/shared/gems/bundler-1.16.2/lib/bundler/runtime.rb:1:in `(root)'
Q:/Ruby/jruby-9.1.17.0/lib/ruby/gems/shared/gems/bundler-1.16.2/lib/bundler/runtime.rb:81:in `<main>'
org/jruby/RubyKernel.java:956:in `require'
Q:/Ruby/jruby-9.1.17.0/lib/ruby/gems/shared/gems/bundler-1.16.2/lib/bundler/runtime.rb:76:in `block in require'
org/jruby/RubyKernel.java:1765:in `tap'
Q:/Ruby/jruby-9.1.17.0/lib/ruby/gems/shared/gems/bundler-1.16.2/lib/bundler/runtime.rb:65:in `require'
Q:/Ruby/jruby-9.1.17.0/lib/ruby/gems/shared/gems/bundler-1.16.2/lib/bundler.rb:114:in `require'
O:/git/xxxx/config/application.rb:7:in `(root)'
o:/bundler/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:1:in `(root)'
o:/bundler/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:133:in `perform'
o:/bundler/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:130:in `perform'
o:/bundler/gems/thor-0.20.0/lib/thor/command.rb:27:in `<main>'
org/jruby/RubyKernel.java:956:in `require'
bin/rails:4:in `<main>'
Bundler Error Backtrace:
block in require at Q:/Ruby/jruby-9.1.17.0/lib/ruby/gems/shared/gems/bundler-1.16.2/lib/bundler/runtime.rb:84
each at org/jruby/RubyArray.java:1735
block in require at Q:/Ruby/jruby-9.1.17.0/lib/ruby/gems/shared/gems/bundler-1.16.2/lib/bundler/runtime.rb:76
each at org/jruby/RubyArray.java:1735
require at Q:/Ruby/jruby-9.1.17.0/lib/ruby/gems/shared/gems/bundler-1.16.2/lib/bundler/runtime.rb:65
require at Q:/Ruby/jruby-9.1.17.0/lib/ruby/gems/shared/gems/bundler-1.16.2/lib/bundler.rb:114
<main> at O:/git/xxx/config/application.rb:7
require at org/jruby/RubyKernel.java:956
block in (root) at o:/bundler/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:1
tap at org/jruby/RubyKernel.java:1765
perform at o:/bundler/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:133
perform at o:/bundler/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:130
run at o:/bundler/gems/thor-0.20.0/lib/thor/command.rb:27
invoke_command at o:/bundler/gems/thor-0.20.0/lib/thor/invocation.rb:126
dispatch at o:/bundler/gems/thor-0.20.0/lib/thor.rb:387
perform at o:/bundler/gems/railties-5.1.6/lib/rails/command/base.rb:63
<main> at o:/bundler/gems/railties-5.1.6/lib/rails/command.rb:44
require at org/jruby/R