# MySQL and RoR 2.2.2 -- deadlock?

**URL:** <https://www.ruby-forum.com/t/mysql-and-ror-2-2-2-deadlock/158173>\
**Category:** Rails\
**Created:** [January 20, 2009, 4:29am UTC](https://www.ruby-forum.com/t/mysql-and-ror-2-2-2-deadlock/158173 "2009-01-20T04:29:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kedarmhaswade](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/5fc32e/32.png) [@kedarmhaswade](https://www.ruby-forum.com/u/kedarmhaswade)\
**Post date:** [January 20, 2009, 4:29am UTC](https://www.ruby-forum.com/t/mysql-and-ror-2-2-2-deadlock/158173/1 "2009-01-20T04:29:25Z")

</div>

## Note: Serious criticism follows since I want to see rails improve.

I was a happy camper getting along well with introducing myself with RoR  
2.2.2 when disaster struck and I think I am not alone (a Google search  
indicates so).

So, I am looking for definitive actions to get out of the mess. Please  
don’t suggest to work with sqlite3 to begin with. I want to get mysql  
and rails 2.2.2 to speak to each other _now_.

- Ubuntu installed – 8.0.4.
- Lamp server reinstalled, just to wipe everything clean (sudo apt-get  
install lamp-server, this (hopefully) installs everything right).
- Mysqld started
- Ruby Gems installed.
- gem install rails --\> fetches rails 2.2.2.
- rails --database=mysql people -\> creates the standard structure
- change the database.yml to reflect mysql password.
- change the migrate file a bit to match a model created using  
script/generate model Person
- rake db:migrate

This wreaks a havoc.  
!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please  
install the mysql gem and try again: gem install mysql.  
rake aborted!  
no such file to load – mysql

Somewhere I even saw a fierce reaction (like WTF?) to removing mysql.rb  
from rails 2.2. This is just unfortunate.

- I press on.
- kedar@kedar-laptop:~/Projects/ror/people$ sudo gem install mysql  
[sudo] password for kedar:  
Building native extensions. This could take a while…  
ERROR: Error installing mysql:  
ERROR: Failed to build gem native extension.

A HUGE trace follows. I am losing patience now.

Why doesn’t rails behave?  
Why can’t gem improve the situation?

Please help and sorry to vent the frustration. But where else to vent it  
if not here?

Thank you in advance.

-Kedar

---

<div class="post-metadata">

**Author:** ![kedarmhaswade](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/5fc32e/32.png) [@kedarmhaswade](https://www.ruby-forum.com/u/kedarmhaswade)\
**Post date:** [January 20, 2009, 5:11am UTC](https://www.ruby-forum.com/t/mysql-and-ror-2-2-2-deadlock/158173/2 "2009-01-20T05:11:04Z")

</div>

Hi Kedar,

I am certainly no expert, but I suffered with the error for several  
days too.

I think you need more information on your install line.

I used for OSX 10.5  
sudo gem install mysql – --with-mysql-config=/usr/local/mysql/bin/  
mysql\_config

from:  
[http://www.scribemedia.org/2009/01/02/installing-mysql-gem-on-mac-osx-105/](http://www.scribemedia.org/2009/01/02/installing-mysql-gem-on-mac-osx-105/)

I have included the other links I browsed on the way to the solution  
too. There is likely a path difference with Ubuntu, but maybe this  
will help.

Eric

[http://discuss.joyent.com/viewtopic.php?id=5992](http://discuss.joyent.com/viewtopic.php?id=5992)  
sudo gem install mysql – --with-mysql-include=/usr/local/mysql/  
include/ with-mysql-lib=/usr/local/mysql/lib/

â€¢ A similar change (when rebuilding mysql) was required to install  
the mysql gem:  
â—¦ ./configure --prefix=/web/pkg/mysql/mysql … CPPFLAGS=‘-fPIC’  
â—¦  
â€¢ Installing the mysql gem also required an additional option to  
help it find the libraries  
â—¦ sudo gem install mysql – --with-mysql-config=/web/pkg/mysql/  
current/bin/mysql\_config

I also looked here.

[http://pjforpresident.com/2008/06/20/compiling-mysql-native-bindings-on-os-x-macports/](http://pjforpresident.com/2008/06/20/compiling-mysql-native-bindings-on-os-x-macports/)  
[http://blog.bmn.name/2008/02/rails-gem-install-mysql-throws-error-extconfrb-failed/](http://blog.bmn.name/2008/02/rails-gem-install-mysql-throws-error-extconfrb-failed/)  
[http://blog.springenwerk.com/2008/11/rails-22-and-native-mysql-gem-on-mac-os.html](http://blog.springenwerk.com/2008/11/rails-22-and-native-mysql-gem-on-mac-os.html)

---

<div class="post-metadata">

**Author:** ![kedarmhaswade](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/5fc32e/32.png) [@kedarmhaswade](https://www.ruby-forum.com/u/kedarmhaswade)\
**Post date:** [January 20, 2009, 11:35am UTC](https://www.ruby-forum.com/t/mysql-and-ror-2-2-2-deadlock/158173/3 "2009-01-20T11:35:59Z")

</div>

> 

A shame you omitted the bit with the actual information 🙂  
You’ll need to make sure you have the development packages for both  
ruby and mysql (something like ruby-dev and libmysql-dev)

Fred

---

<div class="post-metadata">

**Author:** ![kedarmhaswade](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/5fc32e/32.png) [@kedarmhaswade](https://www.ruby-forum.com/u/kedarmhaswade)\
**Post date:** [January 20, 2009, 3:43pm UTC](https://www.ruby-forum.com/t/mysql-and-ror-2-2-2-deadlock/158173/4 "2009-01-20T15:43:17Z")

</div>

> I used for OSX 10.5  
> sudo gem install mysql – --with-mysql-config=/usr/local/mysql/bin/  
> mysql\_config

Hi Eric,

Thanks for your help. The problem was that the computer did not have  
libmysqlclient15-dev package which contains mysql\_config. I did the  
following

sudo apt-get install libmysqlclient15-dev

and then gem install mysql worked as expected.

I am going to get this wiki’ed at [Peak Obsession](http://wiki.rubyonrails.com/rails)

Thanks for your help. It’s quite intimidating/challenging for a n00b  
even if s/he is a hacker at heart. The funny part was it was all working  
till I upgraded to rails 2.2.2 in a vein to be on the latest stable  
branch.

-Kedar
