Can't find jruby-openssl, even though it's clearly installed

I am trying to POST to an https URL. I am using JRuby 1.1.4, which I’ve
confirmed by printing JRUBY_VERSION. And I’ve confirmed that
jruby-openssl
is installed. Yet, when I run the program in NetBeans, I see this in
the
Output window:

init:
deps-jar:
Copying 1 file to L:\projects\DailyDecay\build\classes
compile:
run:
Did not find configuration file ‘run_configuration’, using defaults.
JRuby limited openssl loaded. gem install jruby-openssl for full
support.
http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
JRUBY_VERSION is 1.1.4
Exception in thread “AWT-EventQueue-0”
file:/L:/projects/DailyDecay/lib/java/jruby-complete.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems.rb:578:in
report_activate_error': Could not find RubyGem jruby-openssl (>= 0) (Gem::LoadError) from file:/L:/projects/DailyDecay/lib/java/jruby-complete.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems.rb:134:in activate’
from
file:/L:/projects/DailyDecay/lib/java/jruby-complete.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems.rb:49:in
gem' from file:/L:/projects/DailyDecay/lib/java/jruby-complete.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/jruby/openssl/gem.rb:10 from file:/L:/projects/DailyDecay/lib/java/jruby-complete.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/jruby/openssl/gem.rb:124:in use_ssl=’

The top of my source is:
$LOAD_PATH << ‘META-INF/jruby.home/lib/ruby/site_ruby/1.8’
$LOAD_PATH << ‘META-INF/jruby/home/lib/ruby/site_ruby/1.8/jruby/openssl’
require ‘rubygems’
require ‘digest’
require ‘net/http’
require ‘net/https’
require ‘uri’

headers={‘Content-Type’ => ‘application/x-www-form-urlencoded’ }
req = Net::HTTP::Post.new(url.path, headers)
req.form_data = {‘body’ => body}

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

The error occurs on that last line above, setting use_ssl to true.

Finally, here’s my environment:

$ gem list --local

*** LOCAL GEMS ***

actionmailer (2.1.1)
actionpack (2.1.1)
activerecord (2.1.1)
activeresource (2.1.1)
activesupport (2.1.1)
hoe (1.7.0)
httpclient (2.1.2)
jruby-openssl (0.3)
monkeybars (0.6.2)
rails (2.1.1)
rake (0.8.1)
rawr (0.3.2)
rspec (1.1.4)
rubyforge (1.0.0)
soap4r (1.5.8)
sources (0.0.1)

$ jruby -v
jruby 1.1.4 (ruby 1.8.6 patchlevel 114) (2008-08-28 rev 7570) [x86-java]

Clearly, there’s a mismatch somewhere, but everything looks like okay.
Any
idea what I’m missing?

FWIW, this is not a Ruby project in NB. It’s a Java project, since I’m
using monkeybars. I’m sorry to say it, but I’m not sure how to run this
project outside of NB. How can I determine the command line that NB is
invoking the project with?

Also, when I try to run the same code in 1.1.4 JIRB, I am able to get
past
the use_ssl = true statement. However, I get this result when I do the
actual HTTPS POST:

warning: peer certificate won’t be verified in this SSL session
=> #<Net::HTTPInternalServerError 500 Internal Server Error
readbody=true>

I’m not sure if this sheds any light or indicates an unrelated problem
awaiting me downstream.

Thanks for any insights,
Lee

View this message in context:
http://www.nabble.com/Can't-find-jruby-openssl%2C-even-though-it's-clearly-installed-tp19661367p19661367.html
Sent from the JRuby - User mailing list archive at Nabble.com.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

nabblee wrote:

I am trying to POST to an https URL. I am using JRuby 1.1.4, which I’ve
confirmed by printing JRUBY_VERSION. And I’ve confirmed that jruby-openssl
is installed. Yet, when I run the program in NetBeans, I see this in the
Output window:

It looks like there’s a path issue; i.e. it’s not finding the gems.

Perhaps we need to find a way for users to install openssl directly as a
normal library, in addition to a gem.

Clearly, there’s a mismatch somewhere, but everything looks like okay. Any
idea what I’m missing?

FWIW, this is not a Ruby project in NB. It’s a Java project, since I’m
using monkeybars. I’m sorry to say it, but I’m not sure how to run this
project outside of NB. How can I determine the command line that NB is
invoking the project with?

Not sure about the command line, but you might try printing out $: to
see what the load path is. If it doesn’t include something that looks
like your gem location, you’ll probably need to get a jruby.home
property set somewhere.

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Charles Oliver N. wrote:

property set somewhere.

To view the command line (in NB 6.1, anyway), right-click on the
project, select “properties”, and go to Run. There should be a field for
command-line arguments and a separate one for VM options.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

For any Monkeybars app I highly suggest you unpack the gem into your
lib/ruby directory (run ‘gem unpack openssl’ in your lib/ruby
directory). You can’t rely on gems (or Ruby for that matter) being
installed on your target platform, so I’ve found it’s helpful to
develop in as close a condition as your final target platform.

David K.

On Oct 1, 2008, at 10:02 AM, Jacob K. wrote:


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

I am trying to POST to an https URL. I am using JRuby 1.1.4, which I’ve
confirmed by printing JRUBY_VERSION. And I’ve confirmed that
jruby-openssl
is installed. Yet, when I run the program in NetBeans, I see this in
the
Output window:

Are you using your own installation of JRuby, or one bundled with
NetBeans?

James

View this message in context:
http://www.nabble.com/Can't-find-jruby-openssl%2C-even-though-it's-clearly-installed-tp19661367p19766284.html
Sent from the JRuby - User mailing list archive at Nabble.com.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

I’d wager that you have the vanilla MRI installed, and that gem is
MRI’s gem. I believe JRuby uses jgem now. I append j to all of my
JRuby commands so I’ll never get MRI and JRuby mixed up.

David’s suggestion of unpacking your gems into lib/ruby is probably
your best bet, however.

Logan B.
[email protected]
602 714 1148

On Sep 24, 2008, at 6:00 PM, nabblee wrote:

deps-jar:
jruby.home/lib/ruby/site_ruby/1.8/rubygems.rb:578:in
from
$LOAD_PATH << 'META-INF/jruby/home/lib/ruby/site_ruby/1.8/jruby/

rake (0.8.1)

is
readbody=true>


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email