I'm trying to begin Ruby on Rails development on a Windows machine, but I can't get WEBrick to start the default Rails app.
Here's the output from my attempt to create and start the app:
C:\Users\my_user>ruby -v
ruby 2.2.4p230 (2015-12-16 revision 53155) [i386-mingw32]
C:\Users\my_user\Desktop\wkspc>rails new sample_app
[...]
Bundle complete! 11 Gemfile dependencies, 57 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
C:\Users\my_user\Desktop\wkspc>cd sample_app
C:\Users\my_user\Desktop\wkspc\sample_app>rails server
DEPRECATION WARNING: alias_method_chain is deprecated. Please, use Module#prepend instead. From module, you can access the original method using super. (called from require at bin/rails:4)
Bundler::GemRequireError: There was an error while trying to load the gem 'activerecord-jdbcsqlite3-adapter'.
Gem Load Error is: uninitialized constant ActiveRecord::ConnectionAdapters::Column::Format
Backtrace for gem load error is:
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc/type_cast.rb:13:in `<module:TypeCast>'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc/type_cast.rb:7:in `<module:Jdbc>'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc/type_cast.rb:4:in `<module:ConnectionAdapters>'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc/type_cast.rb:3:in `<top>'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc/column.rb:1:in `singleton class'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc/column.rb:70:in `<class:singleton class>'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc/column.rb:68:in `<module:JdbcColumn>'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc/column.rb:12:in `<module:ConnectionAdapters>'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc/column.rb:2:in `<top>'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc/column.rb:1:in `<top>'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc/adapter.rb:1:in `require'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc/adapter.rb:1:in `<module:(root)>'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc/adapter.rb:9:in `<top>'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc.rb:1:in `require'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc.rb:1:in `<top>'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc.rb:52:in `require'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc.rb:52:in `<top>'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc.rb:3:in `require'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc/jdbc.rb:3:in `block in (root)'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc.rb:1:in `each'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc.rb:1:in `block in (root)'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc.rb:9:in `each'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.20/lib/arjdbc.rb:9:in `(root)'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbcsqlite3-adapter-1.3.20/lib/activerecord-jdbcsqlite3-adapter.rb:1:in `(root)'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/activerecord-jdbcsqlite3-adapter-1.3.20/lib/activerecord-jdbcsqlite3-adapter.rb:2:in `<top>'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/bundler-1.12.5/lib/bundler/runtime.rb:1:in `require'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/bundler-1.12.5/lib/bundler/runtime.rb:1:in `block in (root)'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in `tap'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in `require'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `require'
C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `<top>'
bin/rails:4:in `require'
bin/rails:4:in `<top>'
Bundler Error Backtrace:
block in require at C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/bundler-1.12.5/lib/bundler/runtime.rb:90
each at org/jruby/RubyArray.java:1593
block in require at C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/bundler-1.12.5/lib/bundler/runtime.rb:81
each at org/jruby/RubyArray.java:1593
require at C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/bundler-1.12.5/lib/bundler/runtime.rb:70
require at C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/bundler-1.12.5/lib/bundler.rb:102
<top> at C:/Users/my_user/Desktop/wkspc/sample_app/config/application.rb:7
require at org/jruby/RubyKernel.java:944
block in (root) at C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:1
tap at org/jruby/RubyKernel.java:1743
server at C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:88
server at C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:85
<top> at C:/jruby-9.1.2.0/lib/ruby/gems/shared/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:49
require at org/jruby/RubyKernel.java:944
<top> at bin/rails:4
It appears as though the problem is coming from the gem 'activerecord-jdbcsqlite3-adapter', and the error indicates
uninitialized constant ActiveRecord::ConnectionAdapters::Column::Format
Have I skipped some important configuration step? Thanks for your help!
According to this issue, activerecord-jdbc-adapter is still having compatibility issues in Rails 5. There is a branch for rails-5 you can use by using this line in your Gemfile:
gem 'activerecord-jdbc-adapter', :git => "https://github.com/jruby/activerecord-jdbc-adapter.git",
:branch => "rails-5"