# How do you run ruby on windows

**URL:** <https://www.ruby-forum.com/t/how-do-you-run-ruby-on-windows/153663>\
**Category:** Ruby\
**Created:** [November 19, 2008, 10:35pm UTC](https://www.ruby-forum.com/t/how-do-you-run-ruby-on-windows/153663 "2008-11-19T22:35:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![equinox](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/47e85d/32.png) [@equinox](https://www.ruby-forum.com/u/equinox)\
**Post date:** [November 19, 2008, 10:35pm UTC](https://www.ruby-forum.com/t/how-do-you-run-ruby-on-windows/153663/1 "2008-11-19T22:35:26Z")

</div>

Okay so I’ve downloaded the One-Click Ruby Installer for Windows and  
installed it well under C:\Program Files\ruby  
and now what do I need to do to use it? I’ve gone into the command  
line and try to execute some commands but it doesn’t work… where do I  
need to put the .rb files to?

---

<div class="post-metadata">

**Author:** ![equinox](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/47e85d/32.png) [@equinox](https://www.ruby-forum.com/u/equinox)\
**Post date:** [November 19, 2008, 10:46pm UTC](https://www.ruby-forum.com/t/how-do-you-run-ruby-on-windows/153663/2 "2008-11-19T22:46:00Z")

</div>

On Wed, Nov 19, 2008 at 2:31 PM, equinox [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Okay so I’ve downloaded the One-Click Ruby Installer for Windows and  
> installed it well under C:\Program Files\ruby  
> and now what do I need to do to use it? I’ve gone into the command  
> line and try to execute some commands but it doesn’t work… where do I  
> need to put the .rb files to?

Is the ruby binary in your path? Are you typing the following: ruby  
file.rb

–  
“Hey brother Christian with your high and mighty errand, Your actions  
speak  
so loud, I can’t hear a word you’re saying.”

-Greg Graffin (Bad Religion)

---

<div class="post-metadata">

**Author:** ![equinox](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/47e85d/32.png) [@equinox](https://www.ruby-forum.com/u/equinox)\
**Post date:** [November 19, 2008, 10:50pm UTC](https://www.ruby-forum.com/t/how-do-you-run-ruby-on-windows/153663/3 "2008-11-19T22:50:43Z")

</div>

On Nov 19, 2:41 pm, Glen H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> file.rb
> 
> –  
> “Hey brother Christian with your high and mighty errand, Your actions speak  
> so loud, I can’t hear a word you’re saying.”
> 
> -Greg Graffin (Bad Religion)

no it is not in my path, I am using irb as of now… I have tried to  
load it in the irb  
but it doesn’t work…

---

<div class="post-metadata">

**Author:** ![equinox](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/47e85d/32.png) [@equinox](https://www.ruby-forum.com/u/equinox)\
**Post date:** [November 19, 2008, 11:21pm UTC](https://www.ruby-forum.com/t/how-do-you-run-ruby-on-windows/153663/4 "2008-11-19T23:21:47Z")

</div>

Make sure that you have your path setup correctly first, the installer  
should have done this for you if you selected that option.

I used to forget to make sure that I was in the same folder as whatever  
file that I wanted to require into my IRB session before I started. I  
just created a folder C:\rubyscripts\ that I navigate to before I start  
doing anything it is also where I store all my ruby scripts amazingly  
enough.

---

<div class="post-metadata">

**Author:** ![equinox](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/47e85d/32.png) [@equinox](https://www.ruby-forum.com/u/equinox)\
**Post date:** [November 19, 2008, 11:31pm UTC](https://www.ruby-forum.com/t/how-do-you-run-ruby-on-windows/153663/5 "2008-11-19T23:31:09Z")

</div>

On Nov 19, 3:19 pm, Glen H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > > installed it well under C:\Program Files\ruby  
> > > > so loud, I can’t hear a word you’re saying."  
> > > > source file\_name.rb
> 
> –  
> “Hey brother Christian with your high and mighty errand, Your actions speak  
> so loud, I can’t hear a word you’re saying.”
> 
> -Greg Graffin (Bad Religion)

hmm…I think I need to load the file first right in irb using the load  
command?

---

<div class="post-metadata">

**Author:** ![equinox](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/47e85d/32.png) [@equinox](https://www.ruby-forum.com/u/equinox)\
**Post date:** [November 20, 2008, 5:15pm UTC](https://www.ruby-forum.com/t/how-do-you-run-ruby-on-windows/153663/6 "2008-11-20T17:15:11Z")

</div>

Just in case you are having trouble with your Windows path variable,  
here’s how to add a folder to it:

\*Go to your desktop and right click “My Computer”.

\*Select “properties” from the menu.

\*Click the “Advanced” tab.

\*At the bottom of the window, there’s a button labeled “Environment  
Variables”. Click it.

\*There are two listboxes on the window, the bottom one is called “System  
variables”. Scroll through that box until you come across “Path”. Select  
“Path” and click the “Edit” button.

\*Click the “Variable value” textbox and hit the “End” key on your  
keyboard. Type a semi-colon followed by the absolute path to your ruby  
bin folder.

Also, you can always check what folder IRB is running in by typing  
“Dir.pwd”. You can get a list of all the .rb file in the folder IRB is  
currently operating in with “Dir.glob(’\*.rb’)”. Also, you can change the  
path that IRB is operating in with “Dir.chdir(‘c:\my\_ruby\_files’)”.

---

<div class="post-metadata">

**Author:** ![equinox](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/47e85d/32.png) [@equinox](https://www.ruby-forum.com/u/equinox)\
**Post date:** [November 19, 2008, 11:24pm UTC](https://www.ruby-forum.com/t/how-do-you-run-ruby-on-windows/153663/7 "2008-11-19T23:24:08Z")

</div>

On Wed, Nov 19, 2008 at 2:46 PM, equinox [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > Is the ruby binary in your path? Are you typing the following: ruby  
> > load it in the irb  
> > but it doesn’t work…

So you are trying to read a source file and execute the code in irb? To  
do  
that you need to type the following in your irb session:

source file\_name.rb

–  
“Hey brother Christian with your high and mighty errand, Your actions  
speak  
so loud, I can’t hear a word you’re saying.”

-Greg Graffin (Bad Religion)
