When attempting to install a gem using cygwin on a Windows XP machine I received the below error. I was hoping I wasn’t going to have to reinstall RubyGems underneath cygwin because it would have just been a pain. I had Ruby installed and operational underneath cygwin but for some reason rubygems was not working. I decided to instead make an alias to point to the gem command that I had installed straight to Windows. Use the below command to add an alias to cygwin to make gem an available command.
Error: ruby.exe: No such file or directory — /cygdrive/c/ruby/bin/gem (LoadError)
To resolve use the below command from your cygwin bash prompt to create an alias for gem. On my laptop Ruby is installed in C:\ruby so the commands are located in C:\ruby\bin.
- alias gem='C:/\ruby/\bin/\gem'
One thing you need to verify is that Ruby is the same when running from the cygwin bash prompt or from the Windows Dos prompt. You don’t want to get mixed up between the two.