Issue Details (XML | Word | Printable)

Key: JRUBY-1401
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Thomas E Enebo
Reporter: Adam Payne
Votes: 2
Watchers: 4
Operations

If you were logged in you would be able to see more operations.
JRuby

Pathname#realpath fails for Windows drive letters

Created: 03/Oct/07 04:34 PM   Updated: 15/May/09 05:11 PM   Resolved: 29/Apr/09 01:06 PM
Return to search
Component/s: Core Classes/Modules, Windows
Affects Version/s: JRuby 1.0.0, JRuby 1.0.1, JRuby 1.x+
Fix Version/s: JRuby 1.3RC1

Time Tracking:
Not Specified

File Attachments: 1. Text File pathname.rb.patch (1 kB)
2. File realpath_test.rb (0.3 kB)

Environment: Windows
Issue Links:
Related
 

Testcase included: yes
Patch Submitted: Yes


 Description  « Hide

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.



Ricardo Trindade added a comment - 05/Oct/07 11:53 AM

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


Alex Durgin added a comment - 12/Oct/07 02:47 AM

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


Charles Oliver Nutter added a comment - 19/Oct/07 08:15 PM

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?


Charles Oliver Nutter added a comment - 30/Oct/07 02:49 AM

Nick, what's the verdict on this one?


Kazuki Aranami added a comment - 07/Jan/08 09:18 PM

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


Charles Oliver Nutter added a comment - 08/Jan/08 01:29 PM

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


Carlos Kozuszko added a comment - 28/Nov/08 05:37 PM

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.


Charles Oliver Nutter added a comment - 16/Dec/08 07:11 PM

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


Charles Oliver Nutter added a comment - 16/Dec/08 07:11 PM

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


Ricardo Trindade added a comment - 16/Dec/08 07:12 PM

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


Bruce Goodwin added a comment - 14/Jan/09 05:15 PM

"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?


ruivaldo neto added a comment - 05/Feb/09 10:12 AM

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


Charles Oliver Nutter added a comment - 05/Feb/09 05:50 PM

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


Charles Oliver Nutter added a comment - 05/Feb/09 05:50 PM

Er, I mean weneed confirmation of rails working ok.


Charles Oliver Nutter added a comment - 08/Feb/09 06:05 PM

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.


Ricardo Trindade added a comment - 30/Mar/09 01:03 PM

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.


Charles Oliver Nutter added a comment - 30/Mar/09 01:17 PM

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.


Thomas E Enebo added a comment - 29/Apr/09 10:45 AM

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?


Thomas E Enebo added a comment - 29/Apr/09 12:05 PM

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?


Thomas E Enebo added a comment - 29/Apr/09 01:06 PM

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