This week end I was playing around with RadRails, putting it through its paces and seeing if I want to use it to develop my apps. I encountered a problem when I tried to use the Console.
'irb.bat' is not recognized as an internal or external command,
operable program or batch file
I did a little digging around on the internet and found out it was a problem with using Instant Rails and RadRails together. Instant Rails is a self contained development environment for Ruby on Rails on a Widows machine. It does not modify your system environment at all, as a concequence Windows did not know where to find my irb.bat file to run the Ruby shell for the console.
This is easily fixed though, all you have to do is go to
My Computer > Properties > Advanced > Environment Variables > System Variables.
Find the variable named Path, then click Edit and add in the following (this assumes you installed Instant Rails into a directory called InstantRails in your C drive, if not replace the path with your own path):
C:\\InstantRails\\ruby\\bin;
Make sure there is a ; separating the value you add and the current variable value. Windows will now know where to find the Ruby executable files. For completeness you could also add in some more paths to let Widows know where the executables are for MySQL, Apache and PHP.
C:\\InstantRails\\mysql\\bin;C:\\InstantRails\\Apache;C:\\InstantRails\\PHP
There does not seem to be a huge amount of support documentation out there at the moment for RadRails. I think this will improve soon. Aptana has only just taken over the RadRails project and are settling in at the moment, there is a good resource here for setting up RadRails and Instant Rails.
Tebas
April 25th, 2007 at 5:09 pm
Thxs. That’s exactly what I needed
mike
May 23rd, 2007 at 5:18 pm
Sweet! I was about to abandon RadRails.
Thanks for posting this useful info!
Julian
June 16th, 2007 at 12:58 pm
Awesome thanks Ben, I had this problem too.
boris
July 23rd, 2007 at 11:16 pm
Thanks Ben, exactly what I was looking for !
juan
August 27th, 2007 at 6:09 pm
i love people that post the right answers in a concise and direct way.
Raven
December 19th, 2007 at 4:44 pm
Thanks a lot man. Precisely what I was looking for. If I may add, if you have MySql installed, you may want to place the MySql path entry AFTER the instant rails entry specified above.
korny
April 8th, 2008 at 7:36 pm
Very NICE!
Thank you!
Mert
April 29th, 2008 at 3:10 am
Don’t forget to restart Aptana after you set the %PATH% variable. You may lose an hour like I just did, trying to figure out why it still doesn’t work
Brian
June 13th, 2008 at 3:11 am
Thanks for posting the how to. Can’t believe something so simple was so hard to find. Works like a champ now.