Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8497569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:09:45+00:00 2026-06-11T00:09:45+00:00

I am trying to add JRuby support to my C-extension gem, by writing a

  • 0

I am trying to add JRuby support to my C-extension gem, by writing a Java class and executing it when the gem is installed on JRuby. The code in question lives on this branch, with the important files being the java class and the code to load it when used in JRuby

At this point, I am just trying to ensure I have my gem configured correctly, and fully expect it to fail the specs.

When I try to run rspec (or the gem in IRB for that matter) I get the following backtrace

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
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T00:09:47+00:00Added an answer on June 11, 2026 at 12:09 am

    Having recently worked on a JRuby extension myself, here are some of the gotchas which I have found through experiment — and which seem to cause you problems too:

    • The java package must match the Ruby module in which your class sits. If your class is in the PgArrayParser module, your class must be in the pgarrayparser (all lowercase).
    • If you want to instantiate a PgArrayParserEngine class, then you BasicLibraryService must be called PgArrayParserEngineService.
    • When using @JRubyMethod, specify the name of the method.

    I have found Yoko’s article on the subject most useful, along with this recent post.

    I have applied these different elements to your project here, and I can call the method from IRB — and the first spec passes!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

im trying to add a css class in my javascript code but when i
I am trying add picture boxes dynamically. My code is as PictureBox picture =
Im new to asp.net mvc. I'm trying add new model class but it got
Trying to add a class object into a List using reflection, but when invoking
Trying to add a dynamic class value to one of my columns in CGridView:
I'm trying to add an entire folder to the JRuby 1.5 classpath for my
Trying to add a 'class' html attribute, but I think the keyword 'class' is
Trying to add text to QGraphicsView: Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget) { ui->setupUi(this);
Im trying to add a Markdown editor to my site. I've installed MarkdownSharp via
Trying to add a class to a button if there has been any input

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.