Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capistrano Issue #1017

Closed
rwilliams opened this Issue Sep 16, 2013 · 7 comments

Comments

Projects
None yet
3 participants
@rwilliams
Copy link

rwilliams commented Sep 16, 2013

I just started using JRuby head( 815f778 ) up from 1.7.4 and I can no longer deploy my app with Capistrano ( 2.15.5 ).

[deploy:update_code] exception while rolling back: Capistrano::ConnectionError, connection failed for: xxx.xxx.xxx.xxx (NameError: cannot load Java class jline.console.ConsoleReader)
connection failed for: xxx.xxx.xxx.xxx (NameError: cannot load Java class jline.console.ConsoleReader)
$ ruby -v
jruby 1.7.5.dev (1.9.3p392) 2013-09-16 @jruby.revision@ on Java HotSpot(TM) 64-Bit Server VM 1.6.0_51-b11-457-11M4509 [darwin-x86_64]
@enebo

This comment has been minimized.

Copy link
Member

enebo commented Sep 16, 2013

If you execute this:

jruby -e 'require "readline"; p Java::jline.console.ConsoleReader'

Does it print out the constant or blow up? If it works then I am wondering if something is not require'ing readline before trying to access this lower level Java class?

@rwilliams

This comment has been minimized.

Copy link
Author

rwilliams commented Sep 16, 2013

@enebo It prints out the constant fine.

@enebo

This comment has been minimized.

Copy link
Member

enebo commented Sep 16, 2013

Ah. So some gem or capistrano is trying to access this class JLine directly and is not loading readline first. At least this is what I think. If you could add a 'require "readline"' as early as possible you can help confirm this is in fact the issue. It should work if done before whenever this class is trying to be imported.

For 1.7.5 we stopped stuffing the classes from jline directly into jruby.jar but instead require the jline jar if you decide to use readline. It is possible we might revert this change for 1.7.5 just to make things less painful, but in the future we will end up making this change.

@rwilliams

This comment has been minimized.

Copy link
Author

rwilliams commented Sep 16, 2013

I added require 'readline' as the last require to my deploy.rb and it started working again.

@enebo

This comment has been minimized.

Copy link
Member

enebo commented Sep 16, 2013

ok great. So last thing you can do is grep for ConsoleReader through your gems to know which gem is doing this? It might be more desirable to get them to fix this than switch back if it is a gem people frequently update anyways. In any case, we need to know so we can get it fixed for the future.

@rwilliams

This comment has been minimized.

Copy link
Author

rwilliams commented Sep 16, 2013

$ grep "ConsoleReader" . -r

highline-1.6.19/lib/highline/system_extensions.rb:          java_import 'jline.console.ConsoleReader'
highline-1.6.19/lib/highline/system_extensions.rb:          @java_console = ConsoleReader.new(@input.to_inputstream, @output.to_outputstream)
highline-1.6.19/lib/highline/system_extensions.rb:          java_import 'jline.ConsoleReader'
highline-1.6.19/lib/highline/system_extensions.rb:          @java_console = ConsoleReader.new(@java_input, @java_output)
highline-1.6.19/lib/highline.rb:    # Also, JRuby-1.7's ConsoleReader.readLine() needs to be passed the prompt```
@BanzaiMan

This comment has been minimized.

Copy link
Member

BanzaiMan commented Sep 17, 2013

Closing this one.

@BanzaiMan BanzaiMan closed this Sep 17, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.