Webmock: JRuby 9.1.7.0

Created on 2 Mar 2017  ·  7Comments  ·  Source: bblimke/webmock

Fails when loading webmock/rspec but i think its a conflict on my side but i cant sort it out.

NoMethodError: undefined method `call' for nil:NilClass
Did you mean?  caller
                  load at org/jruby/RubyMarshal.java:145
                  load at /Users/jmcnally/.rvm/gems/jruby-9.1.7.0/gems/activesupport-5.0.2/lib/active_support/core_ext/marshal.rb:4
         block in IDNA at /Users/jmcnally/.rvm/gems/jruby-9.1.7.0/gems/addressable-2.5.0/lib/addressable/idna/pure.rb:336
                  open at org/jruby/RubyIO.java:1141
         <module:IDNA> at /Users/jmcnally/.rvm/gems/jruby-9.1.7.0/gems/addressable-2.5.0/lib/addressable/idna/pure.rb:335
  <module:Addressable> at /Users/jmcnally/.rvm/gems/jruby-9.1.7.0/gems/addressable-2.5.0/lib/addressable/idna/pure.rb:20
                <main> at /Users/jmcnally/.rvm/gems/jruby-9.1.7.0/gems/addressable-2.5.0/lib/addressable/idna/pure.rb:19
               require at org/jruby/RubyKernel.java:961
                <main> at /Users/jmcnally/.rvm/gems/jruby-9.1.7.0/gems/addressable-2.5.0/lib/addressable/idna.rb:1
               require at org/jruby/RubyKernel.java:961
                <main> at /Users/jmcnally/.rvm/gems/jruby-9.1.7.0/gems/addressable-2.5.0/lib/addressable/idna.rb:24
               require at org/jruby/RubyKernel.java:961
                <main> at /Users/jmcnally/.rvm/gems/jruby-9.1.7.0/gems/addressable-2.5.0/lib/addressable/uri.rb:1
               require at org/jruby/RubyKernel.java:961
                <main> at /Users/jmcnally/.rvm/gems/jruby-9.1.7.0/gems/addressable-2.5.0/lib/addressable/uri.rb:20
               require at org/jruby/RubyKernel.java:961
                <main> at /Users/jmcnally/.rvm/gems/jruby-9.1.7.0/gems/webmock-1.23.0/lib/webmock.rb:1
               require at org/jruby/RubyKernel.java:961
                <main> at /Users/jmcnally/.rvm/gems/jruby-9.1.7.0/gems/webmock-1.23.0/lib/webmock.rb:3
                  load at org/jruby/RubyKernel.java:979
       block in (root) at /Users/jmcnally/.rvm/gems/jruby-9.1.7.0/gems/webmock-1.23.0/lib/webmock/rspec.rb:1
                  each at org/jruby/RubyArray.java:1733
                (root) at /Users/jmcnally/.rvm/gems/jruby-9.1.7.0/gems/webmock-1.23.0/lib/webmock/rspec.rb:1
                (root) at /Users/jmcnally/projects/chowly/gems/orderup/spec/spec_helper.rb:1
                (root) at /Users/jmcnally/projects/chowly/gems/orderup/spec/spec_helper.rb:2
                (root) at /Users/jmcnally/projects/chowly/gems/orderup/spec/utils/scraper_spec.rb:1
                (root) at /Users/jmcnally/projects/chowly/gems/orderup/spec/utils/scraper_spec.rb:1
                <main> at /Users/jmcnally/.rvm/gems/jruby-9.1.7.0/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1
                  load at org/jruby/RubyKernel.java:979
                <eval> at /Users/jmcnally/.rvm/gems/jruby-9.1.7.0/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1361
                  eval at org/jruby/RubyKernel.java:1000
                <main> at /Users/jmcnally/.rvm/gems/jruby-9.1.7.0/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1359

Most helpful comment

Yep 100%, glad its being tracked.

All 7 comments

Oh hmm, moving the webmock/rspec include to the top of the file resolved it.

@j-mcnally what exactly did you change? I'm getting the same issue

So i was wrong. Activesupport does some strange patching to core_ext marshal.

I fully resolved the issue by downgrading Active support from 5.x to 4.x

Hope that helps. it took a while to figure out the exact problem, but the active support marshall monkey patch seemed to be the root cause.

Not sure if this is a Jruby issue or a Active support issue, it may have been resolved in a newer active support or jruby.

By moving my include it probably loaded the webmock parts above the patch or something not really sure. But the problem came back in the addressable library elsewhere specifically where it loads a binary db that defines ip space and uses marshall load for that.

The full fix was downgrading active support.

@j-mcnally thanks for that! I don't think I'm using anything rails 5 specific so I'll try downgrade.

👍

@j-mcnally and any others googling, this might be it.

https://github.com/rails/rails/issues/28342
https://github.com/jruby/jruby/issues/4526

Yep 100%, glad its being tracked.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Morred picture Morred  ·  14Comments

vangberg picture vangberg  ·  3Comments

lokenmakwana picture lokenmakwana  ·  6Comments

wgordon17 picture wgordon17  ·  5Comments

bootstraponline picture bootstraponline  ·  18Comments