mkristian / jbundler

bundler support for jars for jruby
MIT License
210 stars 39 forks source link

jbundler breaks readline on jruby-head #63

Closed cheald closed 9 years ago

cheald commented 9 years ago

Running jruby-head:

Gemfile:

source "https://rubygems.org"
gem 'jbundler'

And POC script:

require 'bundler/setup'
Bundler.require

require "irb"
IRB.conf[:PROMPT_MODE] = :SIMPLE
IRB.conf[:USE_READLINE] = true
IRB.setup(nil)
workspace = IRB::WorkSpace.new(binding)
irb = IRB::Irb.new(workspace)
IRB.conf[:IRB_RC].call irb.context if IRB.conf[:IRB_RC]
IRB.conf[:MAIN_CONTEXT] = irb.context
trap("SIGINT") { irb.signal_handle }
catch(:IRB_EXIT) { irb.eval_input }

This breaks readline support:

 $ bundle exec jruby console
uri:classloader:/jruby/kernel/kernel.rb:28: warning: unsupported exec option: close_others
Readline was unable to be required, if you need completion or history install readline then reinstall the ruby.
You may follow 'rvm notes' for dependencies and/or read the docs page https://rvm.io/packages/readline/ . Be sure you 'rvm remove X ; rvm install X' to re-compile your ruby with readline support after obtaining the readline libraries.
jruby-head :001 > require 'readline'
LoadError: load error: readline -- java.lang.NoClassDefFoundError: jline/console/history/History
        from org/jruby/RubyKernel.java:941:in `require'
        from (irb):1:in `<eval>'
        from org/jruby/RubyKernel.java:980:in `eval'
        from org/jruby/RubyKernel.java:1293:in `loop'
        from org/jruby/RubyKernel.java:1100:in `catch'
        from console:13:in `block in console'
        from org/jruby/RubyKernel.java:1100:in `catch'
        from console:13:in `<top>'

This is fine on jruby-1.7.19:

$ bundle exec jruby console
jruby-1.7.19 :001 > require 'readline'
 => false
mkristian commented 9 years ago

I am having trouble reproduce your problem. but I am quite sure this commit fixes it: fd1e9c199ff70f0c4a6c96a7e4b6bc0375860c8b

I just release jbundler-0.8.0 with the above patch which should fix your problem.

cheald commented 9 years ago

This did indeed fix it. Thank you!