Reputation: 377
I am trying to create a new Rails app using JRuby, and my Gemfile looks like:
source 'https://rubygems.org'
gem 'rails', '~> 5.0.7'
gem 'activerecord-jdbcmssql-adapter'
gem 'puma', '~> 3.7'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'therubyrhino'
gem 'coffee-rails', '~> 4.2'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
group :development do
gem 'listen'
end
I run bundle install
and it installs successfully.
Problem is when I run either rails s
or rails c
:
Bundler::GemRequireError: There was an error while trying to load the gem 'activerecord-jdbcmssql-adapter'.
Gem Load Error is: uninitialized constant ActiveRecord::ConnectionAdapters::Column::Format
Backtrace for gem load error is:
/app/jruby-9.2.0.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.22/lib/arjdbc/jdbc/type_cast.rb:13:in `module:TypeCast'
/app/jruby-9.2.0.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.22/lib/arjdbc/jdbc/type_cast.rb:7:in `module:Jdbc'
/app/jruby-9.2.0.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.22/lib/arjdbc/jdbc/type_cast.rb:4:in `module:ConnectionAdapters'
/app/jruby-9.2.0.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.22/lib/arjdbc/jdbc/type_cast.rb:3:in `'
The question is: Is activerecord-jdbcmssql-adapter
compatible with Rails5?
Because my requirement is to use JRuby and MS SQL. It seems like this is the only gem available.
If it cannot support Rails 5, can it support Rails 4? What rails 4 version?
Upvotes: 1
Views: 356
Reputation: 377
I have tried it in 4.2.10 and it works, with setting the version for the gem.
See my answer in this question, which has my settings:
Gem Load Error is: undefined method `type_cast_from_database' for class `ArJdbc::MSSQL::UUIDType'
About rails 5 though, I dont know for sure.
Upvotes: 1