Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArgumentError: comparison of Class with Class failed #1538

Closed
kwando opened this Issue Feb 28, 2014 · 3 comments

Comments

Projects
None yet
3 participants
@kwando
Copy link

commented Feb 28, 2014

I'm not really sure this is jruby issue or not, but the code works fine on MRI 2.1.0.

/Users/kwando/.rbenv/versions/jruby-1.7.11/bin/jruby --2.0 -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/kwando/projects/work/abis/bin/rails server -b 0.0.0.0 -p 3000 -e development
ArgumentError: comparison of Class with Class failed
                     < at org/jruby/RubyComparable.java:168
           descendants at /Users/kwando/.rbenv/versions/jruby-1.7.11/lib/ruby/gems/shared/gems/activesupport-4.1.0.rc1/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.11/lib/ruby/gems/shared/gems/activesupport-4.1.0.rc1/lib/active_support/core_ext/class/subclasses.rb:18
                 field at /Users/kwando/.rbenv/versions/jruby-1.7.11/lib/ruby/gems/shared/gems/mongoid-4.0.0.beta1/lib/mongoid/fields.rb:265
                Fields at /Users/kwando/.rbenv/versions/jruby-1.7.11/lib/ruby/gems/shared/gems/mongoid-4.0.0.beta1/lib/mongoid/fields.rb:48
           module_eval at org/jruby/RubyModule.java:2304
       append_features at /Users/kwando/.rbenv/versions/jruby-1.7.11/lib/ruby/gems/shared/gems/activesupport-4.1.0.rc1/lib/active_support/concern.rb:120
               include at org/jruby/RubyModule.java:2085
       append_features at /Users/kwando/.rbenv/versions/jruby-1.7.11/lib/ruby/gems/shared/gems/activesupport-4.1.0.rc1/lib/active_support/concern.rb:117
                  each at org/jruby/RubyArray.java:1613
       append_features at /Users/kwando/.rbenv/versions/jruby-1.7.11/lib/ruby/gems/shared/gems/activesupport-4.1.0.rc1/lib/active_support/concern.rb:117
               include at org/jruby/RubyModule.java:2085
       append_features at /Users/kwando/.rbenv/versions/jruby-1.7.11/lib/ruby/gems/shared/gems/activesupport-4.1.0.rc1/lib/active_support/concern.rb:117
                  each at org/jruby/RubyArray.java:1613
       append_features at /Users/kwando/.rbenv/versions/jruby-1.7.11/lib/ruby/gems/shared/gems/activesupport-4.1.0.rc1/lib/active_support/concern.rb:117
               include at org/jruby/RubyModule.java:2085
  build_file_model_for at /Users/kwando/.rbenv/versions/jruby-1.7.11/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.11/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.11/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.11/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.11/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.11/lib/ruby/gems/shared/bundler/gems/mongoid-grid_fs-059012a2c2a9/lib/mongoid-grid_fs.rb:59
               require at org/jruby/RubyKernel.java:1085
                (root) at /Users/kwando/.rbenv/versions/jruby-1.7.11/lib/ruby/gems/shared/gems/bundler-1.5.3/lib/bundler/runtime.rb:1
                  each at org/jruby/RubyArray.java:1613
               require at /Users/kwando/.rbenv/versions/jruby-1.7.11/lib/ruby/gems/shared/gems/bundler-1.5.3/lib/bundler/runtime.rb:76
                  each at org/jruby/RubyArray.java:1613
               require at /Users/kwando/.rbenv/versions/jruby-1.7.11/lib/ruby/gems/shared/gems/bundler-1.5.3/lib/bundler/runtime.rb:72
               require at /Users/kwando/.rbenv/versions/jruby-1.7.11/lib/ruby/gems/shared/gems/bundler-1.5.3/lib/bundler/runtime.rb:61
               require at /Users/kwando/.rbenv/versions/jruby-1.7.11/lib/ruby/gems/shared/gems/bundler-1.5.3/lib/bundler.rb:131
               require at org/jruby/RubyKernel.java:1085
                (root) at /Users/kwando/projects/work/abis/config/application.rb:14
                   tap at org/jruby/RubyKernel.java:1893
                (root) at /Users/kwando/.rbenv/versions/jruby-1.7.11/lib/ruby/gems/shared/gems/railties-4.1.0.rc1/lib/rails/commands/commands_tasks.rb:1
                server at /Users/kwando/.rbenv/versions/jruby-1.7.11/lib/ruby/gems/shared/gems/railties-4.1.0.rc1/lib/rails/commands/commands_tasks.rb:79
                server at /Users/kwando/.rbenv/versions/jruby-1.7.11/lib/ruby/gems/shared/gems/railties-4.1.0.rc1/lib/rails/commands/commands_tasks.rb:76
               require at org/jruby/RubyKernel.java:1085
          run_command! at /Users/kwando/.rbenv/versions/jruby-1.7.11/lib/ruby/gems/shared/gems/railties-4.1.0.rc1/lib/rails/commands/commands_tasks.rb:40
                  load at org/jruby/RubyKernel.java:1101
                (root) at -e:1

Process finished with exit code 1

Gemfile

source 'https://rubygems.org'

gem 'rails', '4.1.0.rc1'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'


# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails', '~> 4.0'
  gem 'coffee-rails', '~> 4.0'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platforms => :ruby

  gem 'uglifier', '>= 1.3.0'
  gem 'therubyrhino', platform: :jruby
end

gem 'multi_json', '~> 1.7.5'
gem 'jquery-rails'
gem 'bootstrap-sass'
gem 'font-awesome-sass'
gem 'virtus'

# To use ActiveModel has_secure_password
gem 'bcrypt-ruby', '~> 3.0.0'
gem 'mini_magick'
gem 'exifr'
gem 'faraday'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

# Use unicorn as the app server
# gem 'unicorn'

# Deploy with Capistrano
gem 'mongoid', '4.0.0.beta1'
gem 'carrierwave'
gem 'mongoid-grid_fs',    github: 'ahoward/mongoid-grid_fs'
gem 'carrierwave-mongoid', :require => 'carrierwave/mongoid'
# be sure to load mongoid _before_ CanCan
gem 'cancan'
gem "browser"
gem 'thin',               platforms: :mri
gem 'mongoid_rails_migrations'
gem 'dotenv'

gem 'puma'
gem 'torquebox', '3.0.1', platforms: :jruby
gem 'torquebox-cache', '3.0.1', platforms: :jruby
gem 'rails-i18n'

group :development do
  gem 'mailcatcher',      platforms: :mri
  gem 'capistrano', '~> 2.15'
  gem 'rvm-capistrano'
  gem 'foreman'
  gem 'spring'
end

# To use debugger
# gem 'debugger'

group :test do
  gem 'minitest', '~> 5.1'
  #gem 'minitest-reporters'
  gem 'launchy'
  gem 'capybara'
  gem 'factory_girl_rails'
  #gem 'turn'
end
@atambo

This comment has been minimized.

Copy link
Member

commented Apr 27, 2014

Could you try the above without the --2.0 flag? 2.0 mode is very experimental in jruby 1.7.x versions.

@kwando

This comment has been minimized.

Copy link
Author

commented Apr 28, 2014

It is not broken anymore, same project but with an updated Gemfile works flawlessly in jruby 2.0 mode.

source 'https://rubygems.org'

gem 'rails', '4.1.0'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'


# Gems used only for assets and not required
# in production environments by default.
  gem 'sass-rails', '~> 4.0.3'
  gem 'coffee-rails', '~> 4.0.1'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platforms => :ruby

  gem 'uglifier', '>= 1.0.3'
  gem 'therubyrhino', platform: :jruby

gem 'multi_json', '~> 1.7.5'
gem 'jquery-rails'
gem 'bootstrap-sass'
gem 'font-awesome-sass'
gem 'virtus'
gem 'admin_app', path: 'lib/admin_app'
gem 'web_api',   path: 'lib/web_api'

# To use ActiveModel has_secure_password
gem 'bcrypt-ruby', '~> 3.0.0'
gem 'mini_magick'
gem 'exifr'
gem 'faraday'
gem 'identicon'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

# Use unicorn as the app server
# gem 'unicorn'

# Deploy with Capistrano
gem 'mongoid', '~> 4.0.0.beta1'
gem 'carrierwave'
gem 'carrierwave-mongoid', :require => 'carrierwave/mongoid'
# be sure to load mongoid _before_ CanCan
gem 'cancan'
gem 'browser'
gem 'thin', platforms: :mri
gem 'mongoid_rails_migrations'
gem 'dotenv'

gem 'puma', platform: :mri
gem 'torquebox', '3.0.1', platforms: :jruby
gem 'torquebox-cache', '3.0.1', platforms: :jruby
gem 'rails-i18n'
gem 'liquid', '~> 2.6.1'

group :development do
  gem 'mailcatcher', platforms: :mri
  gem 'mina'
  gem 'foreman'
  gem 'meta_request'
end

# To use debugger
# gem 'debugger'

group :test do
  gem 'minitest'
  gem 'minitest-rails'
  gem 'minitest-reporters'
  gem 'launchy'
  gem 'capybara'
  gem 'factory_girl_rails'
  #gem 'turn'
end
@atambo

This comment has been minimized.

Copy link
Member

commented Apr 28, 2014

Cool, looks like it was fixed.

@atambo atambo closed this Apr 28, 2014

@enebo enebo added this to the JRuby 1.7.13 milestone Jun 24, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.