Forum: Ruby Re: Pathname bug on Windows box?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Berger, Daniel (Guest)
on 2006-04-04 18:34
(Received via mailing list)
> --- test.rb ---
>
> always produces:
>
> c:/ruby/lib/ruby/1.8/pathname.rb:341:in `lstat': Invalid
> argument - /c:
> (Errno::EINVAL)
> 	from c:/ruby/lib/ruby/1.8/pathname.rb:341:in `realpath'
> 	from test.rb:2
>
> any ideas? seems like Pathname doesn't support windows at all?

Use pathname2 instead:

C:\eclipse\workspace>pwd
C:\eclipse\workspace

C:\eclipse\workspace>irb
irb(main):001:0> require 'pathname2'
=> true
irb(main):002:0> Pathname.new('.').realpath
=> "C:\\eclipse\\workspace"

Regards,

Dan
This topic is locked and can not be replied to.