JRuby

Pathname#realpath fails for Windows drive letters

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
    03/Oct/07 4:34 PM
    1 kB
    Adam Payne
  2. realpath_test.rb
    03/Oct/07 4:34 PM
    0.3 kB
    Adam Payne

Issue Links

Activity

Hide
Ricardo Trindade added a comment -

The recently launched rails 1.2.4 doesn't work with jruby. This bug seems to be the cause.

Show
Ricardo Trindade added a comment - The recently launched rails 1.2.4 doesn't work with jruby. This bug seems to be the cause.
Hide
Alex Durgin added a comment -

I ran into the same problem with 1.2.4, the provided patch seems to have me going again. windows / java 1.6 / jruby rev. 4578

Show
Alex Durgin added a comment - I ran into the same problem with 1.2.4, the provided patch seems to have me going again. windows / java 1.6 / jruby rev. 4578
Hide
Charles Oliver Nutter added a comment -

We need to reconcile this issue and JRUBY-1422, which makes a fix in the Java code. Ideally, we should not have to patch the stdlib for everything to work right. Who wants to do the legwork to resolve these issues completely?

Show
Charles Oliver Nutter added a comment - We need to reconcile this issue and JRUBY-1422, which makes a fix in the Java code. Ideally, we should not have to patch the stdlib for everything to work right. Who wants to do the legwork to resolve these issues completely?
Hide
Charles Oliver Nutter added a comment -

Nick, what's the verdict on this one?

Show
Charles Oliver Nutter added a comment - Nick, what's the verdict on this one?
Hide
Kazuki Aranami added a comment -

I tried "JRuby Gem for GlassFish v3 10.0.0".
http://weblogs.java.net/blog/arungupta/archive/2008/01/glassfish_v3_ge.html

As a result, the error occurred under the following environment.

OS:Windows XP and Vista
Java VM:1.6.0_03
JRuby:1.0.3

Please refer to the following blog.
http://d.hatena.ne.jp/kimtea/20080108

Show
Kazuki Aranami added a comment - I tried "JRuby Gem for GlassFish v3 10.0.0". http://weblogs.java.net/blog/arungupta/archive/2008/01/glassfish_v3_ge.html As a result, the error occurred under the following environment. OS:Windows XP and Vista Java VM:1.6.0_03 JRuby:1.0.3 Please refer to the following blog. http://d.hatena.ne.jp/kimtea/20080108
Hide
Charles Oliver Nutter added a comment -

Kazuki: I filed your issue separately as JRUBY-1922. Thank you for the report!

Show
Charles Oliver Nutter added a comment - Kazuki: I filed your issue separately as JRUBY-1922. Thank you for the report!
Hide
Carlos Kozuszko added a comment -

I dont see this patch applyed neither on release 1.1.5 nor the trunk version.

I'm still having issues with this, how is that this ticket got closed/fixed?

It makes it frustrating for us Windows users to have to patch jruby each time we need to use it.

Show
Carlos Kozuszko added a comment - I dont see this patch applyed neither on release 1.1.5 nor the trunk version. I'm still having issues with this, how is that this ticket got closed/fixed? It makes it frustrating for us Windows users to have to patch jruby each time we need to use it.
Hide
Charles Oliver Nutter added a comment -

This doesn't seem to ever have actually been resolved...so I'm reopening.

Show
Charles Oliver Nutter added a comment - This doesn't seem to ever have actually been resolved...so I'm reopening.
Hide
Charles Oliver Nutter added a comment -

After all this time, this really doesn't seem to have been resolved; so I'm assigning to 1.1.7.

Show
Charles Oliver Nutter added a comment - After all this time, this really doesn't seem to have been resolved; so I'm assigning to 1.1.7.
Hide
Ricardo Trindade added a comment -

I also had to apply this patch to get rails 2.1 working on jruby trunk on windows vista and XP. after applying the patch rails worked fine

Show
Ricardo Trindade added a comment - I also had to apply this patch to get rails 2.1 working on jruby trunk on windows vista and XP. after applying the patch rails worked fine
Hide
Bruce Goodwin added a comment -

"Me Too" With regard go having to munge this patch in to get Rails 2.2.2 apps working in weblogic on XP.
Does the "Fix Version" of 1.1.7 on this bug mean that it's really going into jruby 1.1.7, or is that just a goal?

Show
Bruce Goodwin added a comment - "Me Too" With regard go having to munge this patch in to get Rails 2.2.2 apps working in weblogic on XP. Does the "Fix Version" of 1.1.7 on this bug mean that it's really going into jruby 1.1.7, or is that just a goal?
Hide
ruivaldo neto added a comment -

Tried to run the test against jruby 1.2.0 (trunk) and everyhing looks fine:

C:\jruby\bin>jruby C:\teste_bug_realpath.rb
Loaded suite C:\teste_bug_realpath
Started
C:\windows
.
Finished in 0.022791 seconds.

1 tests, 1 assertions, 0 failures, 0 errors

C:\jruby\bin>jruby -v
jruby 1.2.0 (ruby 1.8.6 patchlevel 287) (2009-02-04 rev ) [x86-java]

I´m in a Windows Box running java 1.6 update 12

Show
ruivaldo neto added a comment - Tried to run the test against jruby 1.2.0 (trunk) and everyhing looks fine: C:\jruby\bin>jruby C:\teste_bug_realpath.rb Loaded suite C:\teste_bug_realpath Started C:\windows . Finished in 0.022791 seconds. 1 tests, 1 assertions, 0 failures, 0 errors C:\jruby\bin>jruby -v jruby 1.2.0 (ruby 1.8.6 patchlevel 287) (2009-02-04 rev ) [x86-java] I´m in a Windows Box running java 1.6 update 12
Hide
Charles Oliver Nutter added a comment -

We still need confirmation of it being fixed on Windows, so leaving open for now. Thanks for the update Ruivaldo.

Show
Charles Oliver Nutter added a comment - We still need confirmation of it being fixed on Windows, so leaving open for now. Thanks for the update Ruivaldo.
Hide
Charles Oliver Nutter added a comment -

Er, I mean weneed confirmation of rails working ok.

Show
Charles Oliver Nutter added a comment - Er, I mean weneed confirmation of rails working ok.
Hide
Charles Oliver Nutter added a comment -

Ahh, phooey...this one is so old that if the provided case works I'm happy marking it resolved. If it's not fixed, feel free to reopen.

Show
Charles Oliver Nutter added a comment - Ahh, phooey...this one is so old that if the provided case works I'm happy marking it resolved. If it's not fixed, feel free to reopen.
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

Vote (2)
Watch (4)

Dates

  • Created:
    Updated:
    Resolved: