Jruby-openssl gem : Why does it work this way?

I spent a while trying to figure out an error when trying to install the
jruby-openssl gem:

PS C:\mydocs\Work\RubyPCIProjects\pci> jruby --1.9 -S gem install
jruby-openssl
JRuby limited openssl loaded. http://jruby.org/openssl
gem install jruby-openssl for full support.
LoadError: OpenSSL::SSL requires the jruby-openssl gem
(root) at
C:/jruby-1.6.1/lib/ruby/site_ruby/shared/jruby/openssl/autoloads/ssl.rb:8
connection_for at
C:/jruby-1.6.1/lib/ruby/site_ruby/shared/jruby/openssl/autoloads/ssl.rb:317
request at
C:/jruby-1.6.1/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:367
fetch_http at
C:/jruby-1.6.1/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:202
fetch_http at
C:/jruby-1.6.1/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:212
send at org/jruby/RubyBasicObject.java:1694
send at org/jruby/RubyKernel.java:2085
fetch_path at
C:/jruby-1.6.1/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:230
load_specs at
C:/jruby-1.6.1/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:254
list at
C:/jruby-1.6.1/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:227
each at org/jruby/RubyArray.java:1602
list at
C:/jruby-1.6.1/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:223
find_matching_with_errors at
C:/jruby-1.6.1/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:146
fetch_with_errors at
C:/jruby-1.6.1/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:88
find_gems_with_sources at
C:/jruby-1.6.1/lib/ruby/site_ruby/1.8/rubygems/dependency_installer.rb:108
find_spec_by_name_and_version at
C:/jruby-1.6.1/lib/ruby/site_ruby/1.8/rubygems/dependency_installer.rb:228
install at
C:/jruby-1.6.1/lib/ruby/site_ruby/1.8/rubygems/dependency_installer.rb:260
execute at
C:/jruby-1.6.1/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:120
each at org/jruby/RubyArray.java:1602
execute at
C:/jruby-1.6.1/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:115
invoke at
C:/jruby-1.6.1/lib/ruby/site_ruby/1.8/rubygems/command.rb:278
process_args at
C:/jruby-1.6.1/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:133
run at
C:/jruby-1.6.1/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:103
run at
C:/jruby-1.6.1/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:64
(root) at C:/jruby-1.6.1/bin/gem:21

Which I thought was pretty interesting anyway, since I thought I was
doing
the right thing (gem install jruby-openssl to fix the issue with gem
install
jruby-openssl, haha).

But I also went to that url (http://jruby.org/openssl) and was confused
what
I was supposed to do, until an idea hit me:

PS C:\mydocs\Work\RubyPCIProjects\pci> jruby --1.9
-rjruby/openssl/gem_only
-S gem install jruby-openssl
Fetching: bouncy-castle-java-1.5.0146.1.gem (1991680B)
Fetching: jruby-openssl-0.7.4.gem (623104B)
Successfully installed bouncy-castle-java-1.5.0146.1
Successfully installed jruby-openssl-0.7.4
2 gems installed

After that, everything was golden:

PS C:\mydocs\Work\RubyPCIProjects\pci> jruby --1.9 -S gem install
jruby-openssl
Successfully installed jruby-openssl-0.7.4
1 gem installed

Why is it like this? It seems really confusing and I really felt lucky
that
I remembered passing the ‘-r’ flag to require a gem or library on the
command-line. Is this something that can be made simpler, like
including
the option to install jruby-openssl from the installer? I just hope I
don’t
forget this the next time.

-Nick K.

It definitely should not be that way. Is that only in 1.9 mode? Please
file a bug at http://bugs.jruby.org.

/Nick

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs