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

Method Missing: org.jruby.RubyInteger.int2fix #5216

Closed
erikogan opened this Issue Jun 11, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@erikogan
Copy link

erikogan commented Jun 11, 2018

Environment

Upgrading a project from jRuby 9.1.17.0 to 9.2.0.0 on OS X and Linux in a CI Docker container:

% jruby -v
jruby 9.2.0.0 (2.5.0) 2018-05-24 81156a8 Java HotSpot(TM) 64-Bit Server VM 25.152-b16 on 1.8.0_152-b16 +jit [darwin-x86_64]
% uname -a
Darwin inquanok 17.6.0 Darwin Kernel Version 17.6.0: Tue May  8 15:22:16 PDT 2018; root:xnu-4570.61.1~1/RELEASE_X86_64 x86_64

(My environment generally has JRUBY_OPTS=--debug set, but I don’t believe that is relevant.)

The project is a Rails 5.1 application using jruby-pg, and the error occurs on environment initialization, the example below is starting RSpec, but a rails console will also trigger it. [example updated because the rails console error is easier to read]

Expected Behavior

jRuby 9.1.17.0 has no trouble loading jruby-pg in a rails context. I can provide a link to a stripped down repository exhibiting the issue, but it’s a pretty easy reproduction case, I doubt even Rails is required in the mix.

Actual Behavior

My first suspicion was that jruby-pg needed to be updated to work with jRuby 9.2, but the INT2FIX macro still exists in MRI 2.5, so I suspect this may be a more general issue. Since @headius is the author of jruby-pg, I figure he’ll know best where it should be fixed. I’m happy to close this issue and reopen it over there if I surmised incorrectly.

LoadError: load error: pg_ext -- java.lang.NoSuchMethodError: org.jruby.RubyInteger.int2fix(Lorg/jruby/Ruby;J)Lorg/jruby/RubyNumeric;
                                          require at org/jruby/RubyKernel.java:970
                           require_with_backports at /Users/erik/.rbenv/versions/jruby-9.2.0.0/gemsets/export_service/gems/backports-3.11.3/lib/backports/std_lib.rb:9
                                 block in require at /Users/erik/.rbenv/versions/jruby-9.2.0.0/gemsets/export_service/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292
                                  load_dependency at /Users/erik/.rbenv/versions/jruby-9.2.0.0/gemsets/export_service/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:258
                                          require at /Users/erik/.rbenv/versions/jruby-9.2.0.0/gemsets/export_service/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292
                                           <main> at /Users/erik/.rbenv/versions/jruby-9.2.0.0/gemsets/export_service/gems/jruby-pg-0.1-java/lib/pg.rb:4
                                          require at org/jruby/RubyKernel.java:970
                           require_with_backports at /Users/erik/.rbenv/versions/jruby-9.2.0.0/gemsets/export_service/gems/backports-3.11.3/lib/backports/std_lib.rb:9
                                 block in require at /Users/erik/.rbenv/versions/jruby-9.2.0.0/gemsets/export_service/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292
                                  load_dependency at /Users/erik/.rbenv/versions/jruby-9.2.0.0/gemsets/export_service/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:258
                                          require at /Users/erik/.rbenv/versions/jruby-9.2.0.0/gemsets/export_service/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292
                                           <main> at /Users/erik/.rbenv/versions/jruby-9.2.0.0/gemsets/export_service/bundler/gems/redshift_exporter-233118d3f14d/lib/redshift_exporter.rb:1
                                          require at org/jruby/RubyKernel.java:970
                           require_with_backports at /Users/erik/.rbenv/versions/jruby-9.2.0.0/gemsets/export_service/gems/backports-3.11.3/lib/backports/std_lib.rb:9
                                 block in require at /Users/erik/.rbenv/versions/jruby-9.2.0.0/gemsets/export_service/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292
                                  load_dependency at /Users/erik/.rbenv/versions/jruby-9.2.0.0/gemsets/export_service/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:258
                                          require at /Users/erik/.rbenv/versions/jruby-9.2.0.0/gemsets/export_service/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292
                                           <main> at /Users/erik/.rbenv/versions/jruby-9.2.0.0/gemsets/export_service/bundler/gems/redshift_exporter-233118d3f14d/lib/redshift_exporter.rb:4
                                             load at org/jruby/RubyKernel.java:1001
                                  block in (root) at /Users/erik/work/export_service/config/initializers/zzz_redshift_exporter.rb:1
                                  load_dependency at /Users/erik/.rbenv/versions/jruby-9.2.0.0/gemsets/export_service/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:258
                                           (root) at /Users/erik/work/export_service/config/initializers/zzz_redshift_exporter.rb:3
                                  block in (root) at /Users/erik/.rbenv/versions/jruby-9.2.0.0/gemsets/export_service/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:1
                                             load at /Users/erik/.rbenv/versions/jruby-9.2.0.0/gemsets/export_service/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:286
                                             load at /Users/erik/.rbenv/versions/jruby-9.2.0.0/gemsets/export_service/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:286
                 block in load_config_initializer at /Users/erik/.rbenv/versions/jruby-9.2.0.0/gemsets/export_service/gems/railties-5.1.6/lib/rails/engine.rb:655
                                             each at org/jruby/RubyArray.java:1801
                              block in instrument at /Users/erik/.rbenv/versions/jruby-9.2.0.0/gemsets/export_service/gems/activesupport-5.1.6/lib/active_support/notifications.rb:168
                                    instance_exec at org/jruby/RubyBasicObject.java:2677
                                              run at /Users/erik/.rbenv/versions/jruby-9.2.0.0/gemsets/export_service/gems/railties-5.1.6/lib/rails/initializable.rb:30
                        block in run_initializers at /Users/erik/.rbenv/versions/jruby-9.2.0.0/gemsets/export_service/gems/railties-5.1.6/lib/rails/initializable.rb:59
                              block in tsort_each at /Users/erik/.rbenv/versions/jruby-9.2.0.0/lib/ruby/stdlib/tsort.rb:228
       block in each_strongly_connected_component at /Users/erik/.rbenv/versions/jruby-9.2.0.0/lib/ruby/stdlib/tsort.rb:350
  block in each_strongly_connected_component_from at /Users/erik/.rbenv/versions/jruby-9.2.0.0/lib/ruby/stdlib/tsort.rb:422
           each_strongly_connected_component_from at /Users/erik/.rbenv/versions/jruby-9.2.0.0/lib/ruby/stdlib/tsort.rb:431
  block in each_strongly_connected_component_from at /Users/erik/.rbenv/versions/jruby-9.2.0.0/lib/ruby/stdlib/tsort.rb:421
                                             each at org/jruby/RubyArray.java:1801
                                 tsort_each_child at /Users/erik/.rbenv/versions/jruby-9.2.0.0/gemsets/export_service/gems/railties-5.1.6/lib/rails/initializable.rb:48
                                             call at org/jruby/RubyMethod.java:117
           each_strongly_connected_component_from at /Users/erik/.rbenv/versions/jruby-9.2.0.0/lib/ruby/stdlib/tsort.rb:415
       block in each_strongly_connected_component at /Users/erik/.rbenv/versions/jruby-9.2.0.0/lib/ruby/stdlib/tsort.rb:349
                                             each at org/jruby/RubyArray.java:1801
                                             call at org/jruby/RubyMethod.java:129
                          load_config_initializer at /Users/erik/.rbenv/versions/jruby-9.2.0.0/gemsets/export_service/gems/railties-5.1.6/lib/rails/engine.rb:654
                                           Engine at /Users/erik/.rbenv/versions/jruby-9.2.0.0/gemsets/export_service/gems/railties-5.1.6/lib/rails/engine.rb:612
                                           Engine at /Users/erik/.rbenv/versions/jruby-9.2.0.0/gemsets/export_service/gems/railties-5.1.6/lib/rails/engine.rb:611
                each_strongly_connected_component at /Users/erik/.rbenv/versions/jruby-9.2.0.0/lib/ruby/stdlib/tsort.rb:347
                                       tsort_each at /Users/erik/.rbenv/versions/jruby-9.2.0.0/lib/ruby/stdlib/tsort.rb:226
                                           <main> at /Users/erik/.rbenv/versions/jruby-9.2.0.0/lib/ruby/stdlib/tsort.rb:205
                                          require at org/jruby/RubyKernel.java:970
                           require_with_backports at /Users/erik/.rbenv/versions/jruby-9.2.0.0/gemsets/export_service/gems/backports-3.11.3/lib/backports/std_lib.rb:9
                                 run_initializers at /Users/erik/.rbenv/versions/jruby-9.2.0.0/gemsets/export_service/gems/railties-5.1.6/lib/rails/initializable.rb:58
                                      initialize! at /Users/erik/.rbenv/versions/jruby-9.2.0.0/gemsets/export_service/gems/railties-5.1.6/lib/rails/application.rb:353
                                           (root) at /Users/erik/work/export_service/config/environment.rb:7
                                           (root) at /Users/erik/.rbenv/versions/jruby-9.2.0.0/gemsets/export_service/gems/railties-5.1.6/lib/rails/application.rb:1
                             require_environment! at /Users/erik/.rbenv/versions/jruby-9.2.0.0/gemsets/export_service/gems/railties-5.1.6/lib/rails/application.rb:329
             require_application_and_environment! at /Users/erik/.rbenv/versions/jruby-9.2.0.0/gemsets/export_service/gems/railties-5.1.6/lib/rails/command/actions.rb:16
                                          perform at /Users/erik/.rbenv/versions/jruby-9.2.0.0/gemsets/export_service/gems/railties-5.1.6/lib/rails/commands/console/console_command.rb:96
                                              run at /Users/erik/.rbenv/versions/jruby-9.2.0.0/gemsets/export_service/gems/thor-0.20.0/lib/thor/command.rb:27
                                           <main> at /Users/erik/.rbenv/versions/jruby-9.2.0.0/gemsets/export_service/gems/thor-0.20.0/lib/thor/invocation.rb:126
                                          require at org/jruby/RubyKernel.java:970
                                           <main> at bin/rails:6
@headius

This comment has been minimized.

Copy link
Member

headius commented Jun 12, 2018

Oops.

@headius

This comment has been minimized.

Copy link
Member

headius commented Jun 12, 2018

Breakage occurred in 1ddd4dd when the return value was specialized to RubyInteger from RubyNumeric.

I think the best option would be to add a new method for that other signature and revert the change in JRuby. @kares I'm going to go ahead and do that...let me know if you have any concerns.

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.