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

No such file to load -- rack when booting JRuby 1.6.0RC1 Rails app in Tomcat

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.6RC1
    • Fix Version/s: JRuby 1.6RC3
    • Labels:
      None
    • Environment:
      Windows Server 2008, Tomcat 6.0, Rails 3.0.3, JRuby 1.6.0RC1
    • Number of attachments :
      0

      Description

      When deploying a WAR into Tomcat with bundled jruby-jars 1.6.0.rc1 and rack 1.0.5 (which gets bundled automatically with JRuby 1.6.0RC1), I get the following message in the browser when requesting the app in the browser:

      Application initialization failed: no such file to load – rack
      from /C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%206.0/work/Catalina/localhost/_/loader/vendor/rack.rb:7:in `(root)'
      from org/jruby/RubyKernel.java:1041:in `require'
      from /C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%206.0/work/Catalina/localhost/_/loader/vendor/rack.rb:28:in `boot!'
      from /C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%206.0/work/Catalina/localhost/_/loader/jruby/rack/boot/rack.rb:10:in `(class Rack)'
      from /C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%206.0/work/Catalina/localhost/_/loader/jruby/rack/boot/rack.rb:8:in `(root)'
      from org/jruby/RubyKernel.java:1066:in `load'
      from /C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%206.0/work/Catalina/localhost/_/loader/jruby/rack/boot/rack.rb:1:in `(root)'

      It seems that this error existed quite a while ago and is now present again in JRuby 1.6.0RC1?

        Issue Links

          Activity

          Hide
          Diego Plentz added a comment - - edited

          Same environment, same error.

          Show
          Diego Plentz added a comment - - edited Same environment, same error.
          Hide
          Diego Plentz added a comment - - edited

          More info: it happens using "bundle install" or "bundle install --deployment". Could be warbler the problem? I'm using warbler (1.2.1).

          Show
          Diego Plentz added a comment - - edited More info: it happens using "bundle install" or "bundle install --deployment". Could be warbler the problem? I'm using warbler (1.2.1).
          Hide
          Diego Plentz added a comment -

          RackInitializationException: no suck file to load --rack from file: c:/tomcat/webapps/bestsales/WEB-INF/lib/jruby-rack-1.0.5.jar!/vendor/rack.rb:7
          ...
          caused by RaiseException: no such file to load – rack

          Show
          Diego Plentz added a comment - RackInitializationException: no suck file to load --rack from file: c:/tomcat/webapps/bestsales/WEB-INF/lib/jruby-rack-1.0.5.jar!/vendor/rack.rb:7 ... caused by RaiseException: no such file to load – rack
          Hide
          Diego Plentz added a comment -

          Probably related: JRUBY-4353.

          Show
          Diego Plentz added a comment - Probably related: JRUBY-4353 .
          Hide
          Nick Sieger added a comment -

          This is related to JRUBY-5281 which unfortunately was in RC1 but is now fixed.

          Show
          Nick Sieger added a comment - This is related to JRUBY-5281 which unfortunately was in RC1 but is now fixed.
          Hide
          Nick Sieger added a comment -

          Note that JRuby-Rack 1.0.5 also has this bug, make sure and use JRuby-Rack 1.0.6 along with JRuby 1.6.0.RC2.

          Show
          Nick Sieger added a comment - Note that JRuby-Rack 1.0.5 also has this bug, make sure and use JRuby-Rack 1.0.6 along with JRuby 1.6.0.RC2.
          Hide
          Diego Plentz added a comment -

          To people that could find this post while looking for a solution:

          http://stackoverflow.com/questions/4732241/warbler-no-such-file-to-load-error/4797155#4797155

          Show
          Diego Plentz added a comment - To people that could find this post while looking for a solution: http://stackoverflow.com/questions/4732241/warbler-no-such-file-to-load-error/4797155#4797155
          Hide
          Diego Plentz added a comment - - edited

          Running it on Win2008 + Tomcat 6

          25/01/2011 17:36:26 org.apache.catalina.core.ApplicationContext log
          GRAVE: Warning: error application could not be initialized
          org.jruby.rack.RackInitializationException: no such file to load – rack
          from file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%206.0/webapps/ROOT/WEB-INF/lib/jruby-rack-1.0.6.rc1.jar!/vendor/rack.rb:7

          /WEB-INF/lib $ ls
          jruby-core-1.6.0.RC1.jar jruby-rack-1.0.6.rc1.jar jruby-stdlib-1.6.0.RC1.jar ojdbc6.jar tasks

          In my machine(where I generated this war file):
          > gem list
          ...
          jruby-jars (1.6.0.rc1)
          jruby-launcher (1.0.5 java)
          jruby-openssl (0.7.3)
          jruby-rack (1.0.6.rc1)
          ...

          ps: when you deploy a .war file to tomcat 6, it automatically decompress to a folder with the same war name.

          Show
          Diego Plentz added a comment - - edited Running it on Win2008 + Tomcat 6 — 25/01/2011 17:36:26 org.apache.catalina.core.ApplicationContext log GRAVE: Warning: error application could not be initialized org.jruby.rack.RackInitializationException: no such file to load – rack from file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%206.0/webapps/ROOT/WEB-INF/lib/jruby-rack-1.0.6.rc1.jar!/vendor/rack.rb:7 — /WEB-INF/lib $ ls jruby-core-1.6.0.RC1.jar jruby-rack-1.0.6.rc1.jar jruby-stdlib-1.6.0.RC1.jar ojdbc6.jar tasks — In my machine(where I generated this war file): > gem list ... jruby-jars (1.6.0.rc1) jruby-launcher (1.0.5 java) jruby-openssl (0.7.3) jruby-rack (1.0.6.rc1) ... ps: when you deploy a .war file to tomcat 6, it automatically decompress to a folder with the same war name.
          Hide
          Diego Plentz added a comment -
          Show
          Diego Plentz added a comment - Just tried using jruby-rack-1.0.6.rc1.jar and http://ci.jruby.org/snapshots/jruby-complete-1.6.0.RC1.jar . Same error: 26/01/2011 12:59:13 org.apache.catalina.core.ApplicationContext log GRAVE: Warning: error application could not be initialized org.jruby.rack.RackInitializationException: no such file to load – rack from file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%206.0/webapps/ROOT/WEB-INF/lib/jruby-rack-1.0.6.rc1.jar!/vendor/rack.rb:7:in `(root)' from org/jruby/RubyKernel.java:1040:in `require' from file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%206.0/webapps/ROOT/WEB-INF/lib/jruby-rack-1.0.6.rc1.jar!/vendor/rack.rb:28:in `boot!' from file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%206.0/webapps/ROOT/WEB-INF/lib/jruby-rack-1.0.6.rc1.jar!/jruby/rack/boot/rack.rb:10:in `(class Rack)' from file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%206.0/webapps/ROOT/WEB-INF/lib/jruby-rack-1.0.6.rc1.jar!/jruby/rack/boot/rack.rb:8:in `(root)' from org/jruby/RubyKernel.java:1065:in `load'
          Hide
          Diego Plentz added a comment -

          Just found the root cause of this problem. My Tomcat installation path (as well as Robert's) contain white spaces. The error doesn't happen if I install tomcat in c:/tomcat directly.

          Show
          Diego Plentz added a comment - Just found the root cause of this problem. My Tomcat installation path (as well as Robert's) contain white spaces. The error doesn't happen if I install tomcat in c:/tomcat directly.
          Hide
          Nick Sieger added a comment -

          Right, in that sense it's the same problem as JRUBY-5281. This is supposed to be fixed in RC2 and I fixed it in the JRuby-Rack 1.0.6.rc1 release yesterday. So, my question is why you're still seeing it? Did I fix the bug incorrectly or are the fixes not taking effect in your environment for some reason?

          Show
          Nick Sieger added a comment - Right, in that sense it's the same problem as JRUBY-5281 . This is supposed to be fixed in RC2 and I fixed it in the JRuby-Rack 1.0.6.rc1 release yesterday. So, my question is why you're still seeing it? Did I fix the bug incorrectly or are the fixes not taking effect in your environment for some reason?
          Hide
          lucas dicioccio added a comment -

          I think that there's still an issue with spaces and accents. I did not figure-out exactly what happens yet.

          I've been looking at test_jar_complete.rb and it seems that, when I try adding a test for paths with accents, there's an error at building the correct dirname. As an example, when trying to build the dir "hi_" with an "" UTF-8 (0xc3a9) the test process will actually build "hi_" with an "" MacRoman (0x89). As a result, when trying to copy the complete jar to the target dir (i.e., a path with UTF-8 accent), the dir is not found and the test fails on an Errno:ENOENT exception.

          It led me to think that there might be another bug in strings/paths handling which shadows the tests in test_jar_complete.rb

          If I'm not clear, somehow, I'll try to reproduce this tomorrow after a pull and I'll push my updates on the test cases in my github tomorrow (I only have http:80 here).

          Show
          lucas dicioccio added a comment - I think that there's still an issue with spaces and accents. I did not figure-out exactly what happens yet. I've been looking at test_jar_complete.rb and it seems that, when I try adding a test for paths with accents, there's an error at building the correct dirname. As an example, when trying to build the dir "hi_" with an "" UTF-8 (0xc3a9) the test process will actually build "hi_" with an "" MacRoman (0x89). As a result, when trying to copy the complete jar to the target dir (i.e., a path with UTF-8 accent), the dir is not found and the test fails on an Errno:ENOENT exception. It led me to think that there might be another bug in strings/paths handling which shadows the tests in test_jar_complete.rb If I'm not clear, somehow, I'll try to reproduce this tomorrow after a pull and I'll push my updates on the test cases in my github tomorrow (I only have http:80 here).
          Hide
          Charles Oliver Nutter added a comment -

          I fixed a problem with loading files that have no-ASCII characters in them just a bit ago. Maybe it will have helped?

          Show
          Charles Oliver Nutter added a comment - I fixed a problem with loading files that have no-ASCII characters in them just a bit ago. Maybe it will have helped?
          Hide
          Diego Plentz added a comment -

          Charles, just got jruby master code, generated a new jruby jar and replaced the RC1. Same error:

          08/02/2011 18:27:59 org.apache.catalina.core.ApplicationContext log
          GRAVE: Application Error
          org.jruby.rack.RackInitializationException: no such file to load – rack
          from file:/C:/Tomcat%206.0/webapps/ROOT/WEB-INF/lib/jruby-rack-1.0.6.rc1.jar!/vendor/rack.rb:7:in `(root)'
          from org/jruby/RubyKernel.java:1038:in `require'
          from file:/C:/Tomcat%206.0/webapps/ROOT/WEB-INF/lib/jruby-rack-1.0.6.rc1.jar!/vendor/rack.rb:28:in `boot!'
          from file:/C:/Tomcat%206.0/webapps/ROOT/WEB-INF/lib/jruby-rack-1.0.6.rc1.jar!/jruby/rack/rails.rb:20:in `boot!'
          from file:/C:/Tomcat%206.0/webapps/ROOT/WEB-INF/lib/jruby-rack-1.0.6.rc1.jar!/jruby/rack/boot/rack.rb:10:in `(class Rack)'
          from file:/C:/Tomcat%206.0/webapps/ROOT/WEB-INF/lib/jruby-rack-1.0.6.rc1.jar!/jruby/rack/boot/rack.rb:8:in `(root)'
          from org/jruby/RubyKernel.java:1063:in `load'
          from file:/C:/Tomcat%206.0/webapps/ROOT/WEB-INF/lib/jruby-rack-1.0.6.rc1.jar!/jruby/rack/boot/rack.rb:1:in `(root)'

          Show
          Diego Plentz added a comment - Charles, just got jruby master code, generated a new jruby jar and replaced the RC1. Same error: 08/02/2011 18:27:59 org.apache.catalina.core.ApplicationContext log GRAVE: Application Error org.jruby.rack.RackInitializationException: no such file to load – rack from file:/C:/Tomcat%206.0/webapps/ROOT/WEB-INF/lib/jruby-rack-1.0.6.rc1.jar!/vendor/rack.rb:7:in `(root)' from org/jruby/RubyKernel.java:1038:in `require' from file:/C:/Tomcat%206.0/webapps/ROOT/WEB-INF/lib/jruby-rack-1.0.6.rc1.jar!/vendor/rack.rb:28:in `boot!' from file:/C:/Tomcat%206.0/webapps/ROOT/WEB-INF/lib/jruby-rack-1.0.6.rc1.jar!/jruby/rack/rails.rb:20:in `boot!' from file:/C:/Tomcat%206.0/webapps/ROOT/WEB-INF/lib/jruby-rack-1.0.6.rc1.jar!/jruby/rack/boot/rack.rb:10:in `(class Rack)' from file:/C:/Tomcat%206.0/webapps/ROOT/WEB-INF/lib/jruby-rack-1.0.6.rc1.jar!/jruby/rack/boot/rack.rb:8:in `(root)' from org/jruby/RubyKernel.java:1063:in `load' from file:/C:/Tomcat%206.0/webapps/ROOT/WEB-INF/lib/jruby-rack-1.0.6.rc1.jar!/jruby/rack/boot/rack.rb:1:in `(root)'
          Hide
          Charles Oliver Nutter added a comment -

          Reopening since users report it's still broken.

          Show
          Charles Oliver Nutter added a comment - Reopening since users report it's still broken.
          Hide
          lucas dicioccio added a comment -

          In JRUBY-5435 I point to a github branch in which I've made to build a test case from this bug.
          Unfortunately, and that's why I've opened the issue, I cannot run the test because mkdir also breaks from within a Jar. I've tried to understand what happens, but it's over my powers (esp. because the 1.9/1.8 separate parts hurts my brain).

          Show
          lucas dicioccio added a comment - In JRUBY-5435 I point to a github branch in which I've made to build a test case from this bug. Unfortunately, and that's why I've opened the issue, I cannot run the test because mkdir also breaks from within a Jar. I've tried to understand what happens, but it's over my powers (esp. because the 1.9/1.8 separate parts hurts my brain).
          Hide
          Robert Glaser added a comment -

          I tried warbling my app with the latest jruby-jars 1.6.0.rc2 and jruby-rack 1.0.6.rc1 (--pre). Still getting the same error.

          Show
          Robert Glaser added a comment - I tried warbling my app with the latest jruby-jars 1.6.0.rc2 and jruby-rack 1.0.6.rc1 (--pre). Still getting the same error.
          Hide
          Charles Oliver Nutter added a comment -

          I re-resolved JRUBY-5281 since it addressed only standalone jruby-complete, which appears to work fine. So the additional issues should be tracked here.

          Show
          Charles Oliver Nutter added a comment - I re-resolved JRUBY-5281 since it addressed only standalone jruby-complete, which appears to work fine. So the additional issues should be tracked here.
          Hide
          Robert Glaser added a comment -

          Also getting the same error with jruby-jars 1.6.2.rc2 and jruby-rack 1.0.6 (final).

          Show
          Robert Glaser added a comment - Also getting the same error with jruby-jars 1.6.2.rc2 and jruby-rack 1.0.6 (final).
          Hide
          Nick Sieger added a comment -

          Hopefully this is fixed once and for all in 196873c.

          Show
          Nick Sieger added a comment - Hopefully this is fixed once and for all in 196873c.
          Hide
          David Lee added a comment -

          Nick, I just recompiled jruby (rvm install jruby-head), built the new jruby-jars, installed jruby-rack 1.0.6 final, made sure Gemfile was using the proper versions... everything is working perfectly now. My issue was specifically tied to the spaces and it works perfectly now. Thank you for the update and work. Looking forward to JRuby 1.6.0 final.

          Show
          David Lee added a comment - Nick, I just recompiled jruby (rvm install jruby-head), built the new jruby-jars, installed jruby-rack 1.0.6 final, made sure Gemfile was using the proper versions... everything is working perfectly now. My issue was specifically tied to the spaces and it works perfectly now. Thank you for the update and work. Looking forward to JRuby 1.6.0 final.
          Hide
          lucas dicioccio added a comment -

          I confirm it works with my setup as well on MacOS: (cf.
          https://github.com/lucasdicioccio/windows-jar-issue-with-spaces )
          Will try on Windows later and re-comment.

          Show
          lucas dicioccio added a comment - I confirm it works with my setup as well on MacOS: (cf. https://github.com/lucasdicioccio/windows-jar-issue-with-spaces ) Will try on Windows later and re-comment.
          Hide
          lucas dicioccio added a comment -

          Verified on WindowsXP, it works well. I've tried with path with spaces and accents. Thanks a lot !

          Show
          lucas dicioccio added a comment - Verified on WindowsXP, it works well. I've tried with path with spaces and accents. Thanks a lot !

            People

            • Assignee:
              Nick Sieger
              Reporter:
              Robert Glaser
            • Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: