Reputation: 284
My setup: Windows 7, ruby 1.9.3p125 (2012-02-16) [i386-mingw32]
In scratchfile.rb, I have:
puts ENV["TESTVAR"]
At my command prompt, I type:
set TESTVAR = hello
ruby scratchfile.rb
I get the following output:
C:\myrubyproject>
Why don't I see the value 'hello'? Thanks!
Upvotes: 0
Views: 847
Reputation: 22325
You shouldn't put spaces around =
.
> set TESTVAR=hello
> ruby -e 'p ENV["TESTVAR"]'
"hello"
Upvotes: 2