Can't Require Gem - Shoes

215 Views Asked by At

I have my simple shoes app running on shoes4 (I have JDK and jRuby installed as well) and I've installed the proper gems using jruby -S gem install <gem>, but when I require the gem inside the app and run it, it fails. I've tried requireing rubygems, and that works by itself, but as soon as I add my gem back, it fails again.

The gem that I am trying to use is called SimpleReq, but I'm pretty sure that the error is being caused by a dependancy (hpricot). Here is my code:

require 'rubygems'
require 'simplereq'
require 'shoes'


options = {
    title: "Shoes App",
    width: 1000
}

Shoes.app options do
  flow(width: 1000) {
    banner "Shoes"
    stack(width: "50%") {
      title "Buttons"
    }
    stack(width: "50%") {
      title "Descriptions"
    }
  }
end

Here's the error:

LoadError: load error: hpricot_scan -- java.lang.NoSuchMethodError: org.jruby.RubyClass.defineMethod(Ljava/lang/String;Lorg/jruby/runtime/callback/Callback;)V
require at org/jruby/RubyKernel.java:959
require at C:/ruby/jruby/jruby-9.1.6.0/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:55
<main> at C:/ruby/jruby/jruby-9.1.6.0/lib/ruby/gems/shared/gems/hpricot-0.8.6-java/lib/hpricot.rb:20
require at org/jruby/RubyKernel.java:959
require at C:/ruby/jruby/jruby-9.1.6.0/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:55
<main> at C:/ruby/jruby/jruby-9.1.6.0/lib/ruby/gems/shared/gems/simplereq-1.0.3/lib/simplereq.rb:1
require at org/jruby/RubyKernel.java:959
(root) at C:/ruby/jruby/jruby-9.1.6.0/lib/ruby/gems/shared/gems/simplereq-1.0.3/lib/simplereq.rb:3
<main> at C:/ruby/jruby/jruby-9.1.6.0/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:1
load at org/jruby/RubyKernel.java:977
<main> at -e:1

Process finished with exit code 1

Any suggestions?

0

There are 0 best solutions below