# Ruby windows environment question

**URL:** <https://www.ruby-forum.com/t/ruby-windows-environment-question/195476>\
**Category:** Ruby\
**Created:** [September 23, 2010, 4:42pm UTC](https://www.ruby-forum.com/t/ruby-windows-environment-question/195476 "2010-09-23T16:42:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![DaShiellS\_Jude\_TSS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/919ad9/32.png) [@DaShiellS\_Jude\_TSS](https://www.ruby-forum.com/u/DaShiellS_Jude_TSS)\
**Post date:** [September 23, 2010, 4:42pm UTC](https://www.ruby-forum.com/t/ruby-windows-environment-question/195476/1 "2010-09-23T16:42:35Z")

</div>

After having installed ruby on a windows system, what environment  
variable do I need to load with my path to my documents directory so  
that I don’t need to key the whole path in each time I send a script to  
ruby for work? I have ruby working much better on Slackware 13.0 and  
use screen readers on all environments and was pleasantly surprised ruby  
speaks when it runs on Windows but I’m having a little trouble setting  
things up to run nicely. The netbeans I.D.E. I found inaccessible and  
aptona can’t be downloaded here since that site didn’t keep their  
certificates up to date. For those interested, screen readers routinely  
get used by dyslectics and blind people I get to use them since I’m  
blind.

---

<div class="post-metadata">

**Author:** ![DaShiellS\_Jude\_TSS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/919ad9/32.png) [@DaShiellS\_Jude\_TSS](https://www.ruby-forum.com/u/DaShiellS_Jude_TSS)\
**Post date:** [September 23, 2010, 6:52pm UTC](https://www.ruby-forum.com/t/ruby-windows-environment-question/195476/2 "2010-09-23T18:52:01Z")

</div>

DaShiell, Jude T. CIV NAVAIR 1490, 1, 26 wrote:

> After having installed ruby on a windows system, what environment  
> variable do I need to load with my path to my documents directory so  
> that I don’t need to key the whole path in each time I send a script to  
> ruby for work?

I presume you mean  
c:\go\file1.rb exists and you want to be able to do

c:\>file1.rb

and have it run.

)

you might be able to get it to work by once “executing it” in explorer.  
It should then show up in PATHEXT, mine is:

[PATHEXT=.COM](http://PATHEXT=.COM);.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.wlua;.lexe;.RB;.RBW

if that doesn’t work then you could write a batch file that searches the  
path, and executes it for you.  
Anybody done this before?  
-r

---

<div class="post-metadata">

**Author:** ![DaShiellS\_Jude\_TSS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/919ad9/32.png) [@DaShiellS\_Jude\_TSS](https://www.ruby-forum.com/u/DaShiellS_Jude_TSS)\
**Post date:** [September 23, 2010, 9:11pm UTC](https://www.ruby-forum.com/t/ruby-windows-environment-question/195476/3 "2010-09-23T21:11:56Z")

</div>

Let’s see, when I ran beer.rb before, I used:  
Ruby “d:/documents and settings/jude.dashiell.DEV/my documents/beer.rb”  
  
I’d like to be able to do:  
Ruby .\beer.rb   
Or even cd rubydir and  
Ruby beer.rb .  
I found out if I run something like:  
Ruby “d:/documents and settings/jude.dashiell.DEV/my documents/beer.rb”

> beer.log   
> The beer.log file was put into d:/documents and  
> settings/jude.dashiell.DEV/my documents/beer.log I didn’t know where  
> that file would land once I made it before.

---

<div class="post-metadata">

**Author:** ![DaShiellS\_Jude\_TSS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/919ad9/32.png) [@DaShiellS\_Jude\_TSS](https://www.ruby-forum.com/u/DaShiellS_Jude_TSS)\
**Post date:** [September 23, 2010, 9:16pm UTC](https://www.ruby-forum.com/t/ruby-windows-environment-question/195476/4 "2010-09-23T21:16:02Z")

</div>

On Sep 23, 11:38 am, “DaShiell, Jude T. CIV NAVAIR 1490, 1, 26”  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> After having installed ruby on a windows system,

What version of Ruby? from where did you download the packages? (a  
nice “ruby -v” of the output will help)

> what environment  
> variable do I need to load with my path to my documents directory so  
> that I don’t need to key the whole path in each time I send a script to  
> ruby for work?

What do you mean by this?

Do you cd into your script directory and want to call it “script.rb”  
and it work?

If so, check RubyInstaller settings when installing like  
“associated .rb with Ruby” and “Add Ruby to the PATH”

> I have ruby working much better on Slackware 13.0 and  
> use screen readers on all environments and was pleasantly surprised ruby  
> speaks when it runs on Windows but I’m having a little trouble setting  
> things up to run nicely. The netbeans I.D.E. I found inaccessible and  
> aptona can’t be downloaded here since that site didn’t keep their  
> certificates up to date. For those interested, screen readers routinely  
> get used by dyslectics and blind people I get to use them since I’m  
> blind.

On NetBeans you need to indicate where it will find the interpreters.  
Everything looks like you haven’t installed a Ruby version that is  
available in the PATH and therefore, NetBeans couldn’t find it.

See the Tools/Ruby platforms menu and look for your Ruby installation  
executable.

---

<div class="post-metadata">

**Author:** ![DaShiellS\_Jude\_TSS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/919ad9/32.png) [@DaShiellS\_Jude\_TSS](https://www.ruby-forum.com/u/DaShiellS_Jude_TSS)\
**Post date:** [September 23, 2010, 9:18pm UTC](https://www.ruby-forum.com/t/ruby-windows-environment-question/195476/5 "2010-09-23T21:18:58Z")

</div>

The package came from [http://www.ruby-lang.org](http://www.ruby-lang.org) and is 1.87p3. The  
environment is windows xpsp3.

---

<div class="post-metadata">

**Author:** ![DaShiellS\_Jude\_TSS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/919ad9/32.png) [@DaShiellS\_Jude\_TSS](https://www.ruby-forum.com/u/DaShiellS_Jude_TSS)\
**Post date:** [September 23, 2010, 11:37pm UTC](https://www.ruby-forum.com/t/ruby-windows-environment-question/195476/6 "2010-09-23T23:37:07Z")

</div>

On Sep 23, 4:18 pm, “DaShiell, Jude T. CIV NAVAIR 1490, 1, 26”  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> The package came fromhttp://www.ruby-lang.organd is 1.87p3. The environment is windows xpsp3.

There is no such version at [ruby-lang.org](http://ruby-lang.org)

Please provide the exact “ruby -v” output in the console.

Also, you can CD into the directory where your script is and invoke:

ruby script.rb
