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.

Details
Technology Errors

fatal: Unable to look up github.com (port 9418) (Name or service not known)

I was attempting to clone a github repo on a Slicehost account and received the error below. Its possible that github.com recently updated DNS so if this happens to you then you can use the temporary fix I located on github’s twitter account.

Error:fatal: Unable to look up github.com (port 9418) (Name or service not known)

This error was caused by attempting to clone edavis10’s redmine repo using the command below.

bash

  1. git clone git://github.com/edavis10/redmine.git
Details
Technology Errors

sudo: sorry, you must have a tty to run sudo

I was recently working on a Perl script that would SSH to another server and run a sudo command on the remote server that was failing. The error that was received is below.

Error: sudo: sorry, you must have a tty to run sudo

The reason for this is an update along the way with sudo locked it down further by adding the below line to /etc/sudoers configuration file.

Details