ruby.exe not recognised when trying to login & use heroku

Also a newbie here, trying to get rails with heroku running. I ran into exactly the same problem today, first the "Could not find RubyGem railties" issue and then after uninstalling Ruby 1.9.2, the problem with heroku not working anymore. I found 2 ways around it, but not sure if either one is great.

Don't uninstall the ruby version that comes with the toolbelt. Instead either

(1): remove it from the PATH. For me, the toolbelt installation added c:\program files\ruby1.9.3 to my PATH system variable. I already had c:\ruby193 (where I installed ruby myself previously) in my user PATH variable. After removing the one that the toolbelt added from PATH, things started working. (note: the c:\ruby193 should be placed before c:\program files\heroku\bin int the PATH system variable or else it wont work)

(2): alternatively, I moved c:\ruby193 from my user PATH to my system PATH. Re-installed the toolbelt, and both ruby and heroku work now. But I do have both versions of ruby in my PATH variable.

Not sure if either way is great because I suspect I now have two versions of ruby installed and being used depending on what I'm doing. But at least allowed me to move on to the next problem, now stuck trying to install heroku plugins.

I thought ruby on rails was supposed to make things easy. It's been 4 days of trying to configure 30 different new tools (end rant)


Another thing you can do, (it works for me) is edit the \bin\heroku.bat.

In the file the reference for the Heroku Ruby Installation Path is marked to Program Files. It comes default in the installation. Change to the current Ruby Installation Path.

In my case, I want only one version of ruby in my machine. So, I uninstalled the ruby that comes with heroku, and installed the 1.9.3. And simply changed the batch file.

I hope that helps. Enjoy.