我正在尝试将 JRuby 支持添加到我的 C 扩展 gem 中,方法是编写一个 Java 类并在 gem 安装在 JRuby 上时执行它。有问题的代码位于这个分支上,重要的文件是java 类和在 JRuby 中使用时加载它的代码
在这一点上,我只是想确保我的 gem 配置正确,并完全期望它不符合规范。
当我尝试运行 rspec(或 IRB 中的 gem)时,我得到以下回溯
NameError: cannot load Java class com.dockyard.PgArrayParser
get_proxy_or_package_under_package at org/jruby/javasupport/JavaUtilities.java:54
method_missing at /Users/dan/.rbenv/versions/jruby-1.6.7.2/lib/ruby/site_ruby/shared/builtin/javasupport/java.rb:51
PgArrayParser at /Users/dan/Projects/dockyard/pg_array_parser/lib/pg_array_parser.rb:6
(root) at /Users/dan/Projects/dockyard/pg_array_parser/lib/pg_array_parser.rb:3
require at org/jruby/RubyKernel.java:1033
require at /Users/dan/.rbenv/versions/jruby-1.6.7.2/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36
(root) at /Users/dan/Projects/dockyard/pg_array_parser/lib/pg_array_parser.rb:2
require at org/jruby/RubyKernel.java:1033
require at /Users/dan/.rbenv/versions/jruby-1.6.7.2/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36
(root) at /Users/dan/Projects/dockyard/pg_array_parser/lib/pg_array_parser.rb:1
require at org/jruby/RubyKernel.java:1033
require at /Users/dan/.rbenv/versions/jruby-1.6.7.2/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36
(root) at /Users/dan/Projects/dockyard/pg_array_parser/spec/spec_helper.rb:1
load at org/jruby/RubyKernel.java:1058
load_spec_files at /Users/dan/Projects/dockyard/pg_array_parser/spec/parser_spec.rb:746
collect at org/jruby/RubyArray.java:2331
load_spec_files at /Users/dan/.rbenv/versions/jruby-1.6.7.2/lib/ruby/gems/1.8/gems/rspec-core-2.10.1/lib/rspec/core/configuration.rb:746
run at /Users/dan/.rbenv/versions/jruby-1.6.7.2/lib/ruby/gems/1.8/gems/rspec-core-2.10.1/lib/rspec/core/command_line.rb:22
run at /Users/dan/.rbenv/versions/jruby-1.6.7.2/lib/ruby/gems/1.8/gems/rspec-core-2.10.1/lib/rspec/core/runner.rb:69
autorun at /Users/dan/.rbenv/versions/jruby-1.6.7.2/lib/ruby/gems/1.8/gems/rspec-core-2.10.1/lib/rspec/core/runner.rb:10
call at org/jruby/RubyProc.java:270
call at org/jruby/RubyProc.java:224