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 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.