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

  • Home
  • SEARCH
  • 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 1056653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:44:47+00:00 2026-05-16T17:44:47+00:00

John-Breedloves-Mac-mini:~ john_breedlove$ irb >> require ‘jruby’ => true >> require ‘zxing’ RuntimeError: ZXing requires

  • 0
John-Breedloves-Mac-mini:~ john_breedlove$ irb
>> require 'jruby'
=> true
>> require 'zxing'
RuntimeError: ZXing requires JRuby
 from /Library/Ruby/Gems/1.8/gems/zxing-0.1.1/lib/zxing.rb:1
 from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
 from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `require'
 from (irb):2
>> 

How is this possible?

Further, how would I write that in a ruby script, though?
I have a file I want to execute called test.rb, which contains the following:

require 'rubygems'
require 'jruby'
require 'zxing'
ZXing.decode 'test.png'

I am executing it from the command-line like so:

ruby test.rb

In this context, how do I include java? Or is this even possible?

  • 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-05-16T17:44:47+00:00Added an answer on May 16, 2026 at 5:44 pm

    You are using the JRuby gem, rather than the JRuby itself.

    JRuby (which ZXing is checking on line 1) is a module that gets defined only after you require 'java' in JRuby.

    This should be clearly stated in ZXing’s documentation, but it doesn’t seem to be.

    Here’s the test output when I run the following from cloned ZXing source code:

    $ ruby -v -I lib -r zxing -e 'p 0'
    ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
    ./lib/zxing.rb:1: ZXing requires JRuby (RuntimeError)
    $ jruby -I lib -r zxing -e 'p 0'
    /Users/asari/Development/src/zxing.rb/lib/zxing.rb:1: ZXing requires JRuby (RuntimeError)
        from /Users/asari/Development/src/zxing.rb/lib/zxing.rb:1
        ...internal jruby stack elided...
        from (unknown).(unknown)(/Users/asari/Development/src/zxing.rb/lib/zxing.rb:1)
        from (unknown).(unknown)(:1)
    $ jruby -r java -I lib -r zxing -e 'p 0'
    0
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any tool to to create: [ 'John', 'Sam', 'Marry' ] from: [
I've been using John Resig's getStyle function from Pro JavaScript Techniques to get the
I'm downloaded the code from John Papa's book here: http://silverlight-data.com/ and am sucessfully running
From John Resig blog : // makeClass - By John Resig (MIT Licensed) function
This is taken from John Resig`s Learning Advanced Javascript #25, called changing the context
This is from John Resig`s Learning Advanced JavaScript #35 http://ejohn.org/apps/learn/#35 , called What happens
John Nunemaker recently blogged about the various ways to define class methods in Ruby,
Table1: id - name 1 - john 2 - david 3 - dilio Table2:
I'm using John Emerson's world map to plot some vacation destinations by lat/long. If
A recent post by John Gruber notes that the following legalese: 3.3.1 — Applications

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.