# Irb not recognized in windows command line

**URL:** <https://www.ruby-forum.com/t/irb-not-recognized-in-windows-command-line/142281>\
**Category:** Ruby\
**Created:** [July 5, 2008, 10:43pm UTC](https://www.ruby-forum.com/t/irb-not-recognized-in-windows-command-line/142281 "2008-07-05T22:43:09Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![bert\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/278dde/32.png) [@bert\_a](https://www.ruby-forum.com/u/bert_a)\
**Post date:** [July 5, 2008, 10:43pm UTC](https://www.ruby-forum.com/t/irb-not-recognized-in-windows-command-line/142281/1 "2008-07-05T22:43:09Z")

</div>

I’m reading Beginning Ruby and followed the installation process , using  
the one-click installer for Windows from Ruby Forge. I successfully  
loaded fxri.  
Received the following message after typing irb in the Windows command  
prompt:

‘irb’ is not recognized as an internal or external command, operable  
program or batch file.

Any suggestions on how to get this working will be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![bert\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/278dde/32.png) [@bert\_a](https://www.ruby-forum.com/u/bert_a)\
**Post date:** [July 5, 2008, 10:58pm UTC](https://www.ruby-forum.com/t/irb-not-recognized-in-windows-command-line/142281/2 "2008-07-05T22:58:44Z")

</div>

Hi Bert,

Have you checked your PATH? It should contain an entry to ruby/bin. If  
not, you’ll need to add it. You might also check, just to make sure  
ruby  
itself is operable, ‘ruby -v’ at the command line.

HTH,  
Bill

----- Original Message -----

---

<div class="post-metadata">

**Author:** ![bert\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/278dde/32.png) [@bert\_a](https://www.ruby-forum.com/u/bert_a)\
**Post date:** [July 5, 2008, 11:17pm UTC](https://www.ruby-forum.com/t/irb-not-recognized-in-windows-command-line/142281/3 "2008-07-05T23:17:17Z")

</div>

Bill W. wrote:

> Hi Bert,
> 
> Have you checked your PATH? It should contain an entry to ruby/bin. If  
> not, you’ll need to add it. You might also check, just to make sure  
> ruby  
> itself is operable, ‘ruby -v’ at the command line.
> 
> HTH,  
> Bill
> 
> ----- Original Message -----

Thank you, Bill!

As you can probably tell, I’m not a programmer. I thought the paths  
would be created automatically since the author of Beginning Ruby just  
said to type irb at the command prompt to get irb(main):001:0\> and this  
will shows it’s installed correctly.

When I enter Ruby commands into fxri, the expected results appear, so  
that is set up correctly.

How would I create a path to ruby/bin? The books I have do not go into  
paths unfortunately.

Bert

---

<div class="post-metadata">

**Author:** ![bert\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/278dde/32.png) [@bert\_a](https://www.ruby-forum.com/u/bert_a)\
**Post date:** [July 5, 2008, 11:36pm UTC](https://www.ruby-forum.com/t/irb-not-recognized-in-windows-command-line/142281/4 "2008-07-05T23:36:34Z")

</div>

Bill W. wrote:

> Hi Bert,
> 
> Have you checked your PATH? It should contain an entry to ruby/bin. If  
> not, you’ll need to add it. You might also check, just to make sure  
> ruby  
> itself is operable, ‘ruby -v’ at the command line.
> 
> HTH,  
> Bill
> 
> ----- Original Message -----

I forgot to mention that ‘ruby -v’ does not work either - get the same  
message “ruby” is not recognized.

---

<div class="post-metadata">

**Author:** ![bert\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/278dde/32.png) [@bert\_a](https://www.ruby-forum.com/u/bert_a)\
**Post date:** [July 6, 2008, 12:14am UTC](https://www.ruby-forum.com/t/irb-not-recognized-in-windows-command-line/142281/5 "2008-07-06T00:14:45Z")

</div>

Bert A. wrote:

> I forgot to mention that ‘ruby -v’ does not work either - get the same  
> message “ruby” is not recognized.

Your path has nothing to do specifically with Ruby. It’s part of the way  
Windows command prompt windows work. Your path is a list of directories.  
When you enter a command at a command prompt, if the command is not  
built into Windows itself (like dir, or chdir), then Windows searches  
for the command in the directories listed in your path. You can make  
temporary changes to your path using the SET PATH= command, or permanent  
changes via the System tab in Control Panel.

When you install Ruby using the One-Click Installer, the installer  
changes your path to include the directory in which it installs the ruby  
and irb commands. That change does not affect existing command prompt  
windows, it only affects command prompt windows that you start after  
running the One-Click Installer. If you continue to use an command  
prompt window that was open before you used the One-Click Installer,  
then that window is still using the old path and therefore can’t find  
ruby or irb.

If you haven’t started a new command prompt window since you installed  
Ruby, close all of the command prompt windows you have open now and  
start a new one. The new path will be in effect and you should be able  
to run ruby and irb.

Here’s more information about the path. It’s for WinXP but I think  
things are very similar in Vista:  
[http://www.computerhope.com/issues/ch000549.htm](http://www.computerhope.com/issues/ch000549.htm).

---

<div class="post-metadata">

**Author:** ![bert\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/278dde/32.png) [@bert\_a](https://www.ruby-forum.com/u/bert_a)\
**Post date:** [July 6, 2008, 12:18am UTC](https://www.ruby-forum.com/t/irb-not-recognized-in-windows-command-line/142281/6 "2008-07-06T00:18:15Z")

</div>

Bert A. wrote:

> I forgot to mention that ‘ruby -v’ does not work either - get the same  
> message “ruby” is not recognized.

Maybe helpful, maybe not:

Are you using a command prompt window that was open before you installed  
ruby? If so, try opening a new window. The environment variable settings  
performed by the installer (such as the PATH to search for executable  
programs) will not take effect retroactively.

---

<div class="post-metadata">

**Author:** ![bert\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/278dde/32.png) [@bert\_a](https://www.ruby-forum.com/u/bert_a)\
**Post date:** [July 6, 2008, 1:05am UTC](https://www.ruby-forum.com/t/irb-not-recognized-in-windows-command-line/142281/7 "2008-07-06T01:05:49Z")

</div>

Joel VanderWerf wrote:

> Bert A. wrote:
> 
> > I forgot to mention that ‘ruby -v’ does not work either - get the same  
> > message “ruby” is not recognized.
> 
> Maybe helpful, maybe not:
> 
> Are you using a command prompt window that was open before you installed  
> ruby? If so, try opening a new window. The environment variable settings  
> performed by the installer (such as the PATH to search for executable  
> programs) will not take effect retroactively.

Thanks so much, Joel. I got it working in the meantime by uninstalling  
Ruby and installing Instant Rails.

---

<div class="post-metadata">

**Author:** ![bert\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/278dde/32.png) [@bert\_a](https://www.ruby-forum.com/u/bert_a)\
**Post date:** [July 6, 2008, 1:04am UTC](https://www.ruby-forum.com/t/irb-not-recognized-in-windows-command-line/142281/8 "2008-07-06T01:04:47Z")

</div>

Tim H. wrote:

> Bert A. wrote:
> 
> > I forgot to mention that ‘ruby -v’ does not work either - get the same  
> > message “ruby” is not recognized.
> 
> Your path has nothing to do specifically with Ruby. It’s part of the way  
> Windows command prompt windows work. Your path is a list of directories.  
> When you enter a command at a command prompt, if the command is not  
> built into Windows itself (like dir, or chdir), then Windows searches  
> for the command in the directories listed in your path. You can make  
> temporary changes to your path using the SET PATH= command, or permanent  
> changes via the System tab in Control Panel.
> 
> When you install Ruby using the One-Click Installer, the installer  
> changes your path to include the directory in which it installs the ruby  
> and irb commands. That change does not affect existing command prompt  
> windows, it only affects command prompt windows that you start after  
> running the One-Click Installer. If you continue to use an command  
> prompt window that was open before you used the One-Click Installer,  
> then that window is still using the old path and therefore can’t find  
> ruby or irb.
> 
> If you haven’t started a new command prompt window since you installed  
> Ruby, close all of the command prompt windows you have open now and  
> start a new one. The new path will be in effect and you should be able  
> to run ruby and irb.
> 
> Here’s more information about the path. It’s for WinXP but I think  
> things are very similar in Vista:  
> [http://www.computerhope.com/issues/ch000549.htm](http://www.computerhope.com/issues/ch000549.htm).

Thanks you very much, Tim!

I actually uninstalled Ruby in the meantime and installed InstantRails.  
It’s working now.

---

<div class="post-metadata">

**Author:** ![bert\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/278dde/32.png) [@bert\_a](https://www.ruby-forum.com/u/bert_a)\
**Post date:** [April 19, 2009, 10:10pm UTC](https://www.ruby-forum.com/t/irb-not-recognized-in-windows-command-line/142281/9 "2009-04-19T22:10:19Z")

</div>

Just for anybody still looking solution having no admin rights in WinXP:

Start  
-\> Control Panel  
-\> System  
-\> Advanced  
-\> Environment Variables  
-\> New for User Variables  
-\> Variable Name: Path, Variable Value: C:\ruby\bin (if installed in  
this folder).
