# Rails 2.2 connection to MySQL

**URL:** <https://www.ruby-forum.com/t/rails-2-2-connection-to-mysql/156284>\
**Category:** Rails\
**Created:** [December 23, 2008, 11:44pm UTC](https://www.ruby-forum.com/t/rails-2-2-connection-to-mysql/156284 "2008-12-23T23:44:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![geneeyuss](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e495f1/32.png) [@geneeyuss](https://www.ruby-forum.com/u/geneeyuss)\
**Post date:** [December 23, 2008, 11:44pm UTC](https://www.ruby-forum.com/t/rails-2-2-connection-to-mysql/156284/1 "2008-12-23T23:44:07Z")

</div>

I have been trying to connect to MySQL thru rails. Initially I had  
rails 2.1.2 and upgraded to rails 2.2 to use RestAPI in sproutcore.  
Once I have upgraded my rails version to 2.2, I have been getting this  
error. All I did is the following:

1. rails addressbook
2. cd addressbook
3. script/generate scaffold Contact first\_name:string lastname:string
4. rake db:migrate

I also change the database.yml to suite MySQL.

I have been getting the below error. Could someone please help me  
resolve this issue

ERROR:  
srilatha-bhuvanapallis-macbook-pro:contacts Latha$ rake db:migrate(in /  
Users/Latha/LearnSproutCore/AddressBookWithDatabase/contacts)  
!!! 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

(See full trace by running task with --trace)

Thanks in advance  
Latha

---

<div class="post-metadata">

**Author:** ![geneeyuss](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e495f1/32.png) [@geneeyuss](https://www.ruby-forum.com/u/geneeyuss)\
**Post date:** [December 24, 2008, 1:00am UTC](https://www.ruby-forum.com/t/rails-2-2-connection-to-mysql/156284/2 "2008-12-24T01:00:17Z")

</div>

On Tue, Dec 23, 2008 at 10:08 AM, geneeyuss [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I have been getting the below error. Could someone please help me  
> resolve this issue

> !!! The bundled mysql.rb driver has been removed from Rails 2.2.  
> Please install the mysql gem and try again: gem install mysql.

So what happened when you followed that instruction?

–  
Hassan S. ------------------------ removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![geneeyuss](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e495f1/32.png) [@geneeyuss](https://www.ruby-forum.com/u/geneeyuss)\
**Post date:** [December 24, 2008, 5:57am UTC](https://www.ruby-forum.com/t/rails-2-2-connection-to-mysql/156284/3 "2008-12-24T05:57:32Z")

</div>

If u are a ubuntu or debian user install mysql library via

sudo apt-get install libmysql-ruby

with regards,  
Gen

> **[Genlinux.rb - \> genlinux.js](http://www.genlinux.org/)**
>
> Articles for developers

geneeyuss wrote:

> I have been trying to connect to MySQL thru rails. Initially I had  
> rails 2.1.2 and upgraded to rails 2.2 to use RestAPI in sproutcore.  
> Once I have upgraded my rails version to 2.2, I have been getting this  
> error. All I did is the following:
> 
> 1. rails addressbook
> 2. cd addressbook
> 3. script/generate scaffold Contact first\_name:string lastname:string
> 4. rake db:migrate
> 
> I also change the database.yml to suite MySQL.
> 
> I have been getting the below error. Could someone please help me  
> resolve this issue
> 
> ERROR:  
> srilatha-bhuvanapallis-macbook-pro:contacts Latha$ rake db:migrate(in /  
> Users/Latha/LearnSproutCore/AddressBookWithDatabase/contacts)  
> !!! 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
> 
> (See full trace by running task with --trace)
> 
> Thanks in advance  
> Latha
