RichardOnRails
2011-Jan-10 21:37 UTC
[rspec-users] RSpec newbie ran rspec 2.4 on WinXP, got HOME undefined
Hi, I''m running WinXP-Pro/SP3 & Ruby 1.8.6 I just got the RSpec Book and successfully ran gem install rspec --version 2.0.0 per the book''s suggestion. In a Command window, I ran K:\>rspec -v and got: K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/rspec- core-2.4.0/lib/rspec/core/configuration_options.rb:9:couldn''t find HOME environment -- expanding `~'' (ArgumentError) I ran "gem install rspec -v 2.4.0" successfully and got the same symptom, except this time the intermediate portions of the error message referred to gems/1.8/gems/rspec-core-2.4.0 I checked my environment variables for HOME; it is undefined. Could it be that RSpec relies on some Ruby 1.9 functionality? Any advice would be gratefully received. -- Richard
Simon Hafner
2011-Jan-10 22:39 UTC
[rspec-users] RSpec newbie ran rspec 2.4 on WinXP, got HOME undefined
On Monday 10 January 2011 22.37:46 RichardOnRails wrote:> Hi, > > I''m running WinXP-Pro/SP3 & Ruby 1.8.6 > > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/rspec- > core-2.4.0/lib/rspec/core/configuration_options.rb:9:couldn''t find > HOME environment -- expanding `~'' (ArgumentError) > > I checked my environment variables for HOME; it is undefined.Sounds like rspec is relying on some *NIX stuff here (HOME is usually pointing to a users home directory). Google how to set environment variables and set HOME to the folder containing your home directory (usually something like C:\documents and settings\<user>).> Any advice would be gratefully received. > -- > Richard-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20110110/a16c1302/attachment.html>
RichardOnRails
2011-Jan-11 02:48 UTC
[rspec-users] RSpec newbie ran rspec 2.4 on WinXP, got HOME undefined
Hi Simon,> Sounds like rspec is relying on some *NIX stuff hereYeah, I recognized that it was looking for a home directory on a *nix box, but I couldn''t think of a counterpart on Windows, because I''ve only got a slew of partitions (C:\, D:\ ...) but no home. You came up with a good insight. I tried my admin subdir in Documents and Settings and noted that one of the subdirectories was gem. That sounded good, but no prize. So I did a search of DandS for rspec. Found a good subdir with lots of rspec entries. Set HOME to that via the control panel. Started a new Command Window so that the new settings would be read in and got. K:\>rspec -v 2.4.0 Mission Accomplished. Thanks for your keen insights. Richard K:\> On Jan 10, 5:39?pm, Simon Hafner <freakgu... at gmail.com> wrote:> On Monday 10 January 2011 22.37:46 RichardOnRails wrote: > > > Hi, > > > I''m running WinXP-Pro/SP3 & Ruby 1.8.6 > > > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/rspec- > > core-2.4.0/lib/rspec/core/configuration_options.rb:9:couldn''t find > > HOME environment -- expanding `~'' (ArgumentError) > > > I checked my environment variables for HOME; it is undefined. > > Sounds like rspec is relying on some *NIX stuff here (HOME is usually pointing > to a users home directory). Google how to set environment variables and set > HOME to the folder containing your home directory (usually something like > C:\documents and settings\<user>). > > > Any advice would be gratefully received. > > -- > > Richard > > > > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users
Luis Lavena
2011-Jan-11 11:39 UTC
[rspec-users] RSpec newbie ran rspec 2.4 on WinXP, got HOME undefined
On Mon, Jan 10, 2011 at 6:37 PM, RichardOnRails <RichardDummyMailbox58407 at uscomputergurus.com> wrote:> Hi, > > I''m running WinXP-Pro/SP3 & Ruby 1.8.6 > > I just got the RSpec Book and successfully ran > gem install rspec --version 2.0.0 > per the book''s suggestion. > > In a Command window, I ran > K:\>rspec -v > and got: > K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/rspec- > core-2.4.0/lib/rspec/core/configuration_options.rb:9:couldn''t find > HOME environment -- expanding `~'' (ArgumentError) > > I ran "gem install rspec -v 2.4.0" successfully and got the same > symptom, > except this time the intermediate portions of the error message > referred to > gems/1.8/gems/rspec-core-2.4.0 > > I checked my environment variables for HOME; it is undefined. > > Could it be that RSpec relies on some Ruby 1.9 functionality?File.expand_path("~") That could trigger the issue. expand_path on 1.8.x depends on HOME been defined. Ruby 1.9 already workaround that properly checking for HOMEDRIVE+HOMEPATH, USERPROFILE and HOME You can avoid that setting HOME to HOMEDRIVE+HOMEPATH: SET HOME=%HOMEDRIVE%%HOMEPATH% And put that in your user environment variables. No other workaround for tilde expansion for 1.8.x -- Luis Lavena AREA 17 - Perfection in design is achieved not when there is nothing more to add, but rather when there is nothing more to take away. Antoine de Saint-Exup?ry