Jruby on Railsのキュウリを見ようとしています。前提条件の 1 つは、前提条件として hpricot を持つ webrat です。
以下を使用して hpricot で gem をインストールしました。
gem install hpricot --source http://code.whytheluckystiff.net --version 0.6.1 --platform java
これにより、hpricot の Java バージョンがインストールされます。hpricot_scan.jar を CLASSPATH に追加しますが、実行すると:
cucumber features -n
次の出力が得られます。
HpricotScanService.java:931:in `hpricot_scan': java.lang.NoSuchMethodError:
org.jruby.runtime.builtin.IRubyObject.getInstanceVariable(Ljava/lang/String;)Lorg/jruby/runtime/builtin/IRubyObject;
from HpricotScanService.java:1324:in `__hpricot_scan'
from null:-1:in `call'
from InvocationCallback.java:67:in `execute'
from FullFunctionCallbackMethod.java:69:in `call'
from DynamicMethod.java:243:in `call'
from CachingCallSite.java:283:in `cacheAndCall'
from CachingCallSite.java:121:in `callBlock'
等
HpricotScanService.java ファイルをコンパイルし、結果の .class ファイルをクラスパスに追加すると、次のようになります。
Then I should see "Run"
private method `scan' called for Hpricot:Module (NoMethodError)
features/step_definitions/webrat_steps.rb:94:in `/^I should see "([^\"]*)"$/'
features/manage_activity.feature:9:in `Then I should see "Run"'
hpricot の新しいバージョンをインストールしようとすると、次のようになります。
ERROR: Failed to build gem native extension.
C:/Program Files/Ruby/jruby-1.2.0/bin/../bin/jruby.bat extconf.rb install hpricot --platform java
C:/Program Files/Ruby/jruby-1.2.0/bin/../lib/ruby/1.8/mkmf.rb:7: JRuby does not support native extensions. Check wiki.jruby.org for alternatives. (Not
ImplementedError)
from C:/Program Files/Ruby/jruby-1.2.0/bin/../lib/ruby/1.8/mkmf.rb:1:in `require'
from extconf.rb:1
私が間違っている/していない/どこで私が愚かであるかについて、誰かの手がかりはありますか?
Windows XP、JRuby 1.2.0 を使用