mongoid / mongoid-grid_fs

A pure Mongoid/Moped implementation of the MongoDB GridFS specification.
Other
83 stars 50 forks source link

Errors on jruby #35

Closed kwando closed 10 years ago

kwando commented 10 years ago
$ RAILS_ENV=production bin/rails s --port 9292
ArgumentError: comparison of Class with Class failed
                     < at org/jruby/RubyComparable.java:168
           descendants at /Users/kwando/.rbenv/versions/jruby-1.7.10/lib/ruby/gems/shared/gems/activesupport-4.0.2/lib/active_support/core_ext/class/subclasses.rb:19
           each_object at org/jruby/RubyObjectSpace.java:173
           descendants at /Users/kwando/.rbenv/versions/jruby-1.7.10/lib/ruby/gems/shared/gems/activesupport-4.0.2/lib/active_support/core_ext/class/subclasses.rb:18
                 field at /Users/kwando/.rbenv/versions/jruby-1.7.10/lib/ruby/gems/shared/gems/mongoid-4.0.0.alpha2/lib/mongoid/fields.rb:243
                Fields at /Users/kwando/.rbenv/versions/jruby-1.7.10/lib/ruby/gems/shared/gems/mongoid-4.0.0.alpha2/lib/mongoid/fields.rb:26
           module_eval at org/jruby/RubyModule.java:2304
       append_features at /Users/kwando/.rbenv/versions/jruby-1.7.10/lib/ruby/gems/shared/gems/activesupport-4.0.2/lib/active_support/concern.rb:114
               include at org/jruby/RubyModule.java:2085
       append_features at /Users/kwando/.rbenv/versions/jruby-1.7.10/lib/ruby/gems/shared/gems/activesupport-4.0.2/lib/active_support/concern.rb:111
                  each at org/jruby/RubyArray.java:1613
       append_features at /Users/kwando/.rbenv/versions/jruby-1.7.10/lib/ruby/gems/shared/gems/activesupport-4.0.2/lib/active_support/concern.rb:111
               include at org/jruby/RubyModule.java:2085
       append_features at /Users/kwando/.rbenv/versions/jruby-1.7.10/lib/ruby/gems/shared/gems/activesupport-4.0.2/lib/active_support/concern.rb:111
                  each at org/jruby/RubyArray.java:1613
       append_features at /Users/kwando/.rbenv/versions/jruby-1.7.10/lib/ruby/gems/shared/gems/activesupport-4.0.2/lib/active_support/concern.rb:111
               include at org/jruby/RubyModule.java:2085
  build_file_model_for at /Users/kwando/.rbenv/versions/jruby-1.7.10/lib/ruby/gems/shared/bundler/gems/mongoid-grid_fs-059012a2c2a9/lib/mongoid-grid_fs.rb:296
           module_exec at org/jruby/RubyModule.java:2335
            initialize at org/jruby/RubyModule.java:1845
            initialize at org/jruby/RubyClass.java:849
  build_file_model_for at /Users/kwando/.rbenv/versions/jruby-1.7.10/lib/ruby/gems/shared/bundler/gems/mongoid-grid_fs-059012a2c2a9/lib/mongoid-grid_fs.rb:295
   build_namespace_for at /Users/kwando/.rbenv/versions/jruby-1.7.10/lib/ruby/gems/shared/bundler/gems/mongoid-grid_fs-059012a2c2a9/lib/mongoid-grid_fs.rb:119
                 init! at /Users/kwando/.rbenv/versions/jruby-1.7.10/lib/ruby/gems/shared/bundler/gems/mongoid-grid_fs-059012a2c2a9/lib/mongoid-grid_fs.rb:67
               Mongoid at /Users/kwando/.rbenv/versions/jruby-1.7.10/lib/ruby/gems/shared/bundler/gems/mongoid-grid_fs-059012a2c2a9/lib/mongoid-grid_fs.rb:580
                (root) at /Users/kwando/.rbenv/versions/jruby-1.7.10/lib/ruby/gems/shared/bundler/gems/mongoid-grid_fs-059012a2c2a9/lib/mongoid-grid_fs.rb:59
               require at org/jruby/RubyKernel.java:1083
                (root) at /Users/kwando/.rbenv/versions/jruby-1.7.10/lib/ruby/gems/shared/gems/bundler-1.5.1/lib/bundler/runtime.rb:1
                  each at org/jruby/RubyArray.java:1613
               require at /Users/kwando/.rbenv/versions/jruby-1.7.10/lib/ruby/gems/shared/gems/bundler-1.5.1/lib/bundler/runtime.rb:76
                  each at org/jruby/RubyArray.java:1613
               require at /Users/kwando/.rbenv/versions/jruby-1.7.10/lib/ruby/gems/shared/gems/bundler-1.5.1/lib/bundler/runtime.rb:72
               require at /Users/kwando/.rbenv/versions/jruby-1.7.10/lib/ruby/gems/shared/gems/bundler-1.5.1/lib/bundler/runtime.rb:61
               require at /Users/kwando/.rbenv/versions/jruby-1.7.10/lib/ruby/gems/shared/gems/bundler-1.5.1/lib/bundler.rb:131
               require at org/jruby/RubyKernel.java:1083
                (root) at /Users/kwando/projects/work/abis/config/application.rb:14
                   tap at org/jruby/RubyKernel.java:1891
                (root) at /Users/kwando/.rbenv/versions/jruby-1.7.10/lib/ruby/gems/shared/gems/railties-4.0.2/lib/rails/commands.rb:1
               require at org/jruby/RubyKernel.java:1083
                (root) at bin/rails:4

Gemfile with only relevant entries

source 'https://rubygems.org'

gem 'rails', '4.0.2'
gem 'mongoid', '4.0.0.alpha2'
gem 'carrierwave'
gem 'mongoid-grid_fs', github: 'ahoward/mongoid-grid_fs'
gem 'carrierwave-mongoid', '~> 0.6.3', :require => 'carrierwave/mongoid'
rmm5t commented 10 years ago

I'm not sure what's causing this, but we just added jruby to the travis build matrix for this project, and it's passing with Mongoid 4.

I don't think carrierwave supports jruby though, but I agree that backtrace looks suspect. If you learn anything more, please to feel free to reopen this, but for now, I've got to close this issue out, until we can get a failing unit test case.

kwando commented 10 years ago

Carrierwave works fine with jruby and rails 3.2.* and mini_magick. It just blows into pieces with rails 4 and mongoid 4, at the moment this project is still on rails 3.2 mostly because of this issue. I'm gonna try to patch away the mongoid-grids_fs from carrierwave (we do not need it) and see if that works.