Technology Errors

ruby.exe: No such file or directory — /cygdrive/c/ruby/bin/gem (LoadError)

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.

Code Snippets

MySQL Ruby Gem: `require’: no such file to load — mysql (LoadError)

I am starting to learn ruby and am working on a test script to import some data into a MySQL database. I am using the below code found on kitebird.com to first get the MySQL connection from Ruby working. The code was producing an error which I figured might be because I installed the MySQL Ruby gem instead of installing the MySQL Ruby module from source.

The below code attempts to connect to the MySQL server to return the MySQL server version.