I haven’t tried autotest on windows for a long time, but I thought it
worked back then. Now, I get this error:
C:\dev\row>autotest
c:/program
files/ruby/lib/ruby/gems/1.8/gems/ZenTest-3.4.2/lib/autotest.rb:294:in expand_path': couldn't find HOME environment -- expanding~/.autotest’ (ArgumentError)
from c:/program
files/ruby/lib/ruby/gems/1.8/gems/ZenTest-3.4.2/lib/autotest.rb:294
from c:/program
files/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in require' from c:/program files/ruby/lib/ruby/gems/1.8/gems/ZenTest-3.4.2/lib/rails_autotest.rb:1 from c:/program files/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:inrequire’
from c:/program
files/ruby/lib/ruby/gems/1.8/gems/ZenTest-3.4.2/bin/autotest:44
from c:/Program Files/ruby/bin/autotest:18
I think I remember having to hand-fix some code originally, but again
it was a long time ago (maybe 6 months ago).
I also tried “autotest -rails” at the top folder of one of my rails
projects, but I got the same error.
Any idea what I’m doing wrong? Or is this a known issue with autotest
perhaps?
I have zentest 3.4.2 (did a gem update zentest to make sure), and I’m
on WinXP SP2.
You haven’t filed a bug so we can track and fix it.
I know, I just thought I’d ask the community if there’s something I
should investigate first, before I bother you with a ticket… I’ll go
ahead and file a bug for it.
I haven’t tried autotest on windows for a long time, but I thought it
worked back then. Now, I get this error:
C:\dev\row>autotest
c:/program
files/ruby/lib/ruby/gems/1.8/gems/ZenTest-3.4.2/lib/autotest.rb:294:in expand_path': couldn't find HOME environment -- expanding~/.autotest’ (ArgumentError)
from c:/program
Do you have the HOME environment variable set?
From ri File.expand_path:
The given pathname may start with a +~+'', which expands to the process owner's home directory (the environment variable +HOME+ must be set correctly).+~+user’’ expands to the named user’s home
directory.
This is arguably a bug in File.expand_path rather than ZenTest. (On
Windows systems, a fallback to ENV[‘HOME’] should be ENV[‘HOMEDRIVE’] +
ENV[‘HOMEPATH’]. Wonder where you report those.
Erght, I forgot about %USERPROFILE%. Well, that leaves the whole thing
rather fuzzy. So, bug in autotest for relying on File.expand_path with a
tilde, or Ruby for letting people rely on it? Or the usual, let’s blame
Microsoft ducks.
ENV[‘HOMEPATH’]. Wonder where you report those.
This has been discussed before. See http://tinyurl.com/y52hs3, among
others.
The fundamental issue is that “~” is a shell thing, not an OS thing. To
me, the bug is that File.expand_path accepts ‘~’ at all. But, things
are what they are. Come to think of it, I could add support for this in
win32-file.
In practice I never use ‘~’. I mostly use ENV[‘HOME’] ||
ENV[‘USERPROFILE’].
Regards,
Dan
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.