JRuby (please use github issues at http://bugs.jruby.org)
  1. JRuby (please use github issues at http://bugs.jruby.org)
  2. JRUBY-5713

JRuby finds C-Ruby 'rake' via PATH over its the script in jruby.home in the complete jar

    Details

    • Type: Bug Bug
    • Status: Reopened Reopened
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Affects Version/s: JRuby 1.6.1
    • Fix Version/s: JRuby 1.6.3
    • Component/s: Standard Library
    • Labels:
      None
    • Number of attachments :
      0

      Description

      JRuby 1.6.1 broke running 'rake' from the copy embedded in the complete jar.

      /usr/bin/java -classpath /home/proyal/.m2/repository/org/jruby/jruby-complete/1.6.1/jruby-complete-1.6.1.jar org.jruby.Main -S rake -T

      FilterInputStream.java:116:in `read': java.lang.NullPointerException
              from FilterInputStream.java:90:in `read'                                                                              
              from LoadServiceResourceInputStream.java:34:in `bufferEntireStream'                                                   
              from LoadServiceResourceInputStream.java:18:in `<init>'                                                               
              from LoadServiceResource.java:80:in `getInputStream'                                                                  
              from ExternalScript.java:50:in `load'                                                                                 
              from LoadService.java:272:in `load'                                                                                   
              from RubyKernel.java:1081:in `loadCommon'                                                                             
              from RubyKernel.java:1063:in `load'                                                                                   
              from RubyKernel$s$0$1$load.gen:65535:in `call'                                                                        
              from DynamicMethod.java:209:in `call'                                                                                 
              from DynamicMethod.java:205:in `call'                                                                                 
              from CachingCallSite.java:282:in `cacheAndCall'                                                                       
              from CachingCallSite.java:139:in `call'                                                                               
              from /var/lib/gems/1.8/bin/rake:19:in `__file__'                                                                      
              from /var/lib/gems/1.8/bin/rake:-1:in `load'                                                                          
              from Ruby.java:671:in `runScript'                                                                                     
              from Ruby.java:575:in `runNormally'                                                                                   
              from Ruby.java:424:in `runFromMain'                                                                                   
              from Main.java:278:in `doRunFromMain'                                                                                 
              from Main.java:198:in `internalRun'                                                                                   
              from Main.java:164:in `run'                                                                                           
              from Main.java:148:in `run'                                                                                           
              from Main.java:128:in `main'  
      

      I believe https://github.com/jruby/jruby/commit/fbc02a4782489375cc7ceaafc9eec473f096cc37 broke it, as it is finding 'rake' on my PATH as part of C-Ruby.

      If I empty my PATH, everything works fine.

        Issue Links

          Activity

          Hide
          Hiro Asari added a comment -

          This is fixed as of 1.6.3. (Maybe 1.6.2 as well.)

          $ cat Rakefile 
          task "hello" do
            puts RUBY_DESCRIPTION
          end
          $ java -cp ~/.m2/repository/org/jruby/jruby-complete/1.6.3/jruby-complete-1.6.3.jar org.jruby.Main -S rake hello
          (in /Users/asari/test2)
          jruby 1.6.3 (ruby-1.8.7-p330) (2011-07-07 965162f) (Java HotSpot(TM) Client VM 1.6.0_26) [darwin-i386-java]
          
          Show
          Hiro Asari added a comment - This is fixed as of 1.6.3. (Maybe 1.6.2 as well.) $ cat Rakefile task "hello" do puts RUBY_DESCRIPTION end $ java -cp ~/.m2/repository/org/jruby/jruby-complete/1.6.3/jruby-complete-1.6.3.jar org.jruby.Main -S rake hello (in /Users/asari/test2) jruby 1.6.3 (ruby-1.8.7-p330) (2011-07-07 965162f) (Java HotSpot(TM) Client VM 1.6.0_26) [darwin-i386-java]
          Hide
          peter royal added a comment -

          Hiro - Did you confirm that you had a copy of 'rake' in your path already? Its unclear from your comment.

          Show
          peter royal added a comment - Hiro - Did you confirm that you had a copy of 'rake' in your path already? Its unclear from your comment.
          Hide
          Hiro Asari added a comment -

          You're right. I have it.

          $ java -Djruby.debug.scriptResolution=true -cp ~/.m2/repository/org/jruby/jruby-complete/1.6.3/jruby-complete-1.6.3.jar org.jruby.Main   -S rake hello
          Found: /usr/bin/rake
          (in /Users/asari/test2)
          jruby 1.6.3 (ruby-1.8.7-p330) (2011-07-07 965162f) (Java HotSpot(TM) Client VM 1.6.0_26) [darwin-i386-java]
          
          Show
          Hiro Asari added a comment - You're right. I have it. $ java -Djruby.debug.scriptResolution=true -cp ~/.m2/repository/org/jruby/jruby-complete/1.6.3/jruby-complete-1.6.3.jar org.jruby.Main -S rake hello Found: /usr/bin/rake (in /Users/asari/test2) jruby 1.6.3 (ruby-1.8.7-p330) (2011-07-07 965162f) (Java HotSpot(TM) Client VM 1.6.0_26) [darwin-i386-java]

            People

            • Assignee:
              Hiro Asari
              Reporter:
              peter royal
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: