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

java -jar jruby-complete.jar -S irb doesn't work anymore #1983

Closed
rdp opened this issue Sep 17, 2014 · 5 comments
Closed

java -jar jruby-complete.jar -S irb doesn't work anymore #1983

rdp opened this issue Sep 17, 2014 · 5 comments
Assignees
Milestone

Comments

@rdp
Copy link
Contributor

@rdp rdp commented Sep 17, 2014

viz https://www.ruby-forum.com/topic/5650169#new
FWIW, the last version that worked was 1.7.13 AFAICT

@enebo enebo added this to the JRuby 1.7.16 milestone Sep 17, 2014
@mkristian mkristian self-assigned this Sep 18, 2014
mkristian added a commit that referenced this issue Sep 18, 2014
@mkristian
Copy link
Member

@mkristian mkristian commented Sep 18, 2014

I did read this on the user list but it worked when finding irb on the file-system. now I found it the failure. thanx for reporting.

@mkristian mkristian closed this Sep 18, 2014
mkristian added a commit that referenced this issue Oct 3, 2014
* fix not more loadService debug
* fix list of activated gems
@mkristian mkristian reopened this Oct 8, 2014
@mkristian
Copy link
Member

@mkristian mkristian commented Oct 8, 2014

spaces in filename or path will still fail the execution of irb

@mkristian
Copy link
Member

@mkristian mkristian commented Nov 11, 2014

more ways to fail it:

java -Djruby.home=classpath:/META-INF/jruby.home -jar maven/jruby-complete/target/jruby-complete-1.7.17-SNAPSHOT.jar -S irb
Channels.java:67:in `checkNotNull': java.lang.NullPointerException: "in" is null!
    from Channels.java:347:in `newChannel'
    from ChannelDescriptor.java:780:in `open'
    from RubyFile.java:1283:in `sysopen'
    from RubyFile.java:1263:in `sysopenInternal19'

or

$ java -Djruby.home=uri:classloader://META-INF/jruby.home -jar maven/jruby-complete/target/jruby-complete-1.7.17-SNAPSHOT.jar -S irb
Errno::ENOENT: No such file or directory - uri:classloader:/META-INF/jruby.home/lib/ruby/1.9/site_ruby/irb/lc/en_GB.UTF-8/encoding_aliases.rb
   initialize at org/jruby/RubyFile.java:361
         open at org/jruby/RubyIO.java:1177
         open at uri:classloader:/META-INF/jruby.home/lib/ruby/1.9/irb/magic-file.rb:7
    real_load at uri:classloader:/META-INF/jruby.home/lib/ruby/1.9/irb/locale.rb:130
         load at uri:classloader:/META-INF/jruby.home/lib/ruby/1.9/irb/locale.rb:110
   initialize at uri:classloader:/META-INF/jruby.home/lib/ruby/1.9/irb/locale.rb:32
  init_config at uri:classloader:/META-INF/jruby.home/lib/ruby/1.9/irb/init.rb:114
        setup at uri:classloader:/META-INF/jruby.home/lib/ruby/1.9/irb/init.rb:16
        start at uri:classloader:/META-INF/jruby.home/lib/ruby/1.9/irb.rb:53
       (root) at uri:classloader:/META-INF/jruby.home/bin/jirb:13

or

$ java -Djruby.native.enabled=false -jar maven/jruby-complete/target/jruby-complete-1.7.17-SNAPSHOT.jar -S irb
Errno::ENOENT: No such file or directory - /home/christian/projects/active/maven/jruby17/maven/jruby-complete/target/jruby-complete-1.7.17-SNAPSHOT.jar!/META-INF/jruby.home/lib/ruby/1.9/site_ruby/irb/lc/en_GB.UTF-8/encoding_aliases.rb
            readable? at org/jruby/RubyFileTest.java:202
          search_file at /home/christian/projects/active/maven/jruby17/maven/jruby-complete/target/jruby-complete-1.7.17-SNAPSHOT.jar!/META-INF/jruby.home/lib/ruby/1.9/irb/locale.rb:148
                 each at org/jruby/RubyArray.java:1613
          search_file at /home/christian/projects/active/maven/jruby17/maven/jruby-complete/target/jruby-complete-1.7.17-SNAPSHOT.jar!/META-INF/jruby.home/lib/ruby/1.9/irb/locale.rb:146

@headius
Copy link
Member

@headius headius commented Nov 12, 2014

So it looks like this logic is trying to read in and evaluate a file based on IRB's FILE location. Unfortuantely that location is inside the jar and File.open does not support URLs.

We probably want to patch IRB to gracefully fail if it can't load this file, or come up with a way it can be loaded without this breakage.

@mkristian
Copy link
Member

@mkristian mkristian commented Nov 12, 2014

the particular thing here is when native is enabled this works:

$ java -Djruby.native.enabled=true -jar maven/jruby-complete/target/jruby-complete-1.7.17-SNAPSHOT.jar -S irb

the first fix was:
88e9f75
and the regexp could be extended to cope with spaces in the path and we could close the issue.

but it feels kind of odd that there is no way to just compare two pathes, and find out whether they belong to the same physical file, without doing uri normalization see also: #2021

@headius FYI File.open( "classpath:/my.rb", 'r' ) do ... does work quite OK dito File.open( "classpath:/my.rb", 'r' ) do ... , etc

yousuketto added a commit to yousuketto/jruby that referenced this issue Nov 22, 2014
* fix not more loadService debug
* fix list of activated gems
@mkristian mkristian added this to the JRuby 1.7.17 milestone Dec 2, 2014
@mkristian mkristian removed this from the JRuby 1.7.16 milestone Dec 2, 2014
mkristian added a commit that referenced this issue Dec 2, 2014
this readable? method now follows the same pattern as writable?, file?,
directory? and exists? and uses the respective FileResource directly.

fixes #2040 and #1983

Sponsored by Lookout Inc.
@mkristian mkristian closed this Dec 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants