Forum: JRuby ArgumentError from OpenSSL::PKey.read

Posted by Jonas Tehler (Guest)
on 2012-09-23 00:17
(Received via mailing list)
Hi

I'm getting this error when running capistrano (2.13.4) with JRuby 
(1.6.7.2) and jruby-openssl (0.7.7)

ArgumentError: wrong number of arguments (2 for 1)

No stacktrace. It works fine on MRI 1.9.3.

I have narrowed it down and it seems to be a problem with 
OpenSSL::PKey.read() only accepting one argument in jruby-openssl but 
accepting two in MRI.

jruby-1.6.7.2 :003 > OpenSSL::PKey.read('foo', 'bar')
ArgumentError: wrong number of arguments (2 for 1)
  from (irb):3:in `evaluate'
  from org/jruby/RubyKernel.java:1088:in `eval'
  from org/jruby/RubyKernel.java:1410:in `loop'
  from org/jruby/RubyKernel.java:1197:in `catch'
  from org/jruby/RubyKernel.java:1197:in `catch'
  from 
/Users/jegt/.rvm/gems/jruby-1.6.7.2/gems/railties-3.2.5/lib/rails/commands/console.rb:47:in 
`start'
  from 
/Users/jegt/.rvm/gems/jruby-1.6.7.2/gems/railties-3.2.5/lib/rails/commands/console.rb:8:in 
`start'
  from 
/Users/jegt/.rvm/gems/jruby-1.6.7.2/gems/railties-3.2.5/lib/rails/commands.rb:41:in 
`(root)'
  from org/jruby/RubyKernel.java:1042:in `require'
  from script/rails:6:in `(root)'

See "OpenSSL::PKey.read(string [, pwd ] )" in 
http://www.ruby-doc.org/stdlib-1.9.3/libdoc/openss...

Am I missing something? Should I use some other openssl implementation 
with jruby?

/ Jonas
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.