Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.0.0, JRuby 1.0.1, JRuby 1.x+
    • Fix Version/s: JRuby 1.3RC1
    • Labels:
      None
    • Environment:
      Windows
    • Testcase included:
      yes
    • Patch Submitted:
      Yes
    • Number of attachments :
      2

      Description

      Pathname's realpath method was not properly handling drive letters in Windows, causing Rails initialization to fail in Edge (1.2.3.x) with errors like:
      C:/jruby/jruby-1.0.1/lib/ruby/1.8/pathname.rb:420:in `realpath_rec': No such file or directory - C:/railstest/C: (Errno::ENOENT)
      from C:/jruby/jruby-1.0.1/lib/ruby/1.8/pathname.rb:453:in `realpath'
      from C:/jruby/jruby-1.0.1/lib/ruby/gems/1.8/gems/rails-1.2.3.7605/lib/initializer.rb:494:in `set_root_path!'
      from C:/jruby/jruby-1.0.1/lib/ruby/gems/1.8/gems/rails-1.2.3.7605/lib/initializer.rb:459:in `initialize'
      from ./script/../config/boot.rb:44:in `new'
      from ./script/../config/boot.rb:44:in `run'
      from ./script/../config/boot.rb:44
      from :1:in `require'
      from :1

      attached test shows failure in windows, patch fixes.

      1. pathname.rb.patch
        1 kB
        Adam Payne
      2. realpath_test.rb
        0.3 kB
        Adam Payne

        Issue Links

          Activity

          Hide
          Ricardo Trindade added a comment -

          This still isn't fixed on trunk.

          If rails isn't on the current working directory, but is on the classpath root, it'll work if this patch is applied, but won't work otherwise.

          The attached patch fixes the issue, but isn't applied.

          Show
          Ricardo Trindade added a comment - This still isn't fixed on trunk. If rails isn't on the current working directory, but is on the classpath root, it'll work if this patch is applied, but won't work otherwise. The attached patch fixes the issue, but isn't applied.
          Hide
          Charles Oliver Nutter added a comment -

          Reopening...there's still remaining issues with this according to Ricardo, so we should actually look at the attached patch and try to apply it.

          Show
          Charles Oliver Nutter added a comment - Reopening...there's still remaining issues with this according to Ricardo, so we should actually look at the attached patch and try to apply it.
          Hide
          Thomas E Enebo added a comment -

          For 1.2 I made a fix which corrected the test case (and I did run Rails and it worked, but that was not rails 2.3.x). [So I made a different fix than the suggested patch] The reason we have not applied this patch is it patches a library which MRI runs fine on windows. We really need test cases so we can fix it in File or some related internal utility class and not start forking standard library files (we largely just merge MRI standard libs). So any volunteers to help shake this issue out into a test case?

          Show
          Thomas E Enebo added a comment - For 1.2 I made a fix which corrected the test case (and I did run Rails and it worked, but that was not rails 2.3.x). [So I made a different fix than the suggested patch] The reason we have not applied this patch is it patches a library which MRI runs fine on windows. We really need test cases so we can fix it in File or some related internal utility class and not start forking standard library files (we largely just merge MRI standard libs). So any volunteers to help shake this issue out into a test case?
          Hide
          Thomas E Enebo added a comment -

          I cannot get this to fail with Rails. Here is what I have tried [Windows XP]:

          1. JRuby on C: drive, Rails app on C: drive
          2. JRuby on C: drive, Rails app on E: drive
          3. JRuby on E: drive, Rails app on E: drive
          4. JRuby on E: drive, Rails app on C: drive

          Ricardo, I am not exactly sure I understand the scenario where Rails does not work on windows because of pathname. Can you give me some instructions?

          Show
          Thomas E Enebo added a comment - I cannot get this to fail with Rails. Here is what I have tried [Windows XP] : 1. JRuby on C: drive, Rails app on C: drive 2. JRuby on C: drive, Rails app on E: drive 3. JRuby on E: drive, Rails app on E: drive 4. JRuby on E: drive, Rails app on C: drive Ricardo, I am not exactly sure I understand the scenario where Rails does not work on windows because of pathname. Can you give me some instructions?
          Hide
          Thomas E Enebo added a comment -

          The last remaining issue has been fixed by some other fix since 1.2 (report from Ricardo – thanks for verifying this for us). Resolving.

          Show
          Thomas E Enebo added a comment - The last remaining issue has been fixed by some other fix since 1.2 (report from Ricardo – thanks for verifying this for us). Resolving.

            People

            • Assignee:
              Thomas E Enebo
              Reporter:
              Adam Payne
            • Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: