My 2 paisas

installing mysql bindings for ruby

Posted on: August 29, 2009

Courtsey: Daniel Lorch

To install mysql bindings for ruby, use this command
#gem install mysql

You might get the following error:

“extconf.rb:1:in `require’: no such file to load — mkmf (LoadError)”

This probably means that you forgot to install the ruby1.8-dev package. Just do an apt-get install ruby1.8-dev to fix this.

Again after this you might this error:

“Could not create Makefile due to some reason [..] Check the mkmf.log file for more details. [..]”

You should do what the error message tells you: check the mkmf.log! Search for this file using find /usr/lib/ruby/gems/1.8/gems/ -name mkmf.log. Usually, this error message appears because you forgot to install the -dev package for the extension you were trying to install. So if you wanted to install the mysql gem, you probably forgot to install the libmysqlclient14-dev first. Do an apt-cache search | grep dev to find the appropriate packages.

Courtsey: Simon Josefsson Datakonsult


(in /home/redmine/redmine)
rake aborted!
No such file or directory – /tmp/mysql.sock

(See full trace by running task with –trace)

The problem is that you need the Ruby MySQL wrappers. This isn’t really clear from the error message. Install it using:

# apt-get install libmysql-ruby


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Links that I liked to save

Blog Stats

  • 45,141 hits
%d bloggers like this: