# Gem install mysql

**URL:** <https://www.ruby-forum.com/t/gem-install-mysql/142824>\
**Category:** Rails\
**Created:** [July 11, 2008, 8:52pm UTC](https://www.ruby-forum.com/t/gem-install-mysql/142824 "2008-07-11T20:52:23Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![skirkpatrick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/73ab20/32.png) [@skirkpatrick](https://www.ruby-forum.com/u/skirkpatrick)\
**Post date:** [July 11, 2008, 8:52pm UTC](https://www.ruby-forum.com/t/gem-install-mysql/142824/1 "2008-07-11T20:52:23Z")

</div>

I’m trying to to ‘gem install mysql’ because it keeps saying that the  
libraries i’m using for mysql are not fit for production.

the packages i have installed for ubuntu hardy 8.04 are:

mysql-client-5.0  
mysql-client-5.0

i am running rails 1.87 and gem 1.2.0

here are my results:

root@webapp1:/u1/app/wonderland/log# gem install mysql  
Building native extensions. This could take a while…  
ERROR: Error installing mysql:  
ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb install mysql  
checking for mysql\_query() in -lmysqlclient… no  
checking for main() in -lm… yes  
checking for mysql\_query() in -lmysqlclient… no  
checking for main() in -lz… yes  
checking for mysql\_query() in -lmysqlclient… no  
checking for main() in -lsocket… no  
checking for mysql\_query() in -lmysqlclient… no  
checking for main() in -lnsl… yes  
checking for mysql\_query() in -lmysqlclient… no  
\*\*\* extconf.rb failed \*\*\*  
Could not create Makefile due to some reason, probably lack of  
necessary libraries and/or headers. Check the mkmf.log file for more  
details. You may need configuration options.

any idea what else i might need to install?

here are some other packages that i might need but i don’t want to break  
production if i don’t have to:

p libdbd-mysql-ruby - Ruby/DBI driver for MySQL  
p libdbd-mysql-ruby1.8 - Ruby/DBI MySQL driver for Ruby 1.8  
p libmysql5.0-cil - MySQL database connector for CLI

does anyone know offhand? thanks!

---

<div class="post-metadata">

**Author:** ![skirkpatrick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/73ab20/32.png) [@skirkpatrick](https://www.ruby-forum.com/u/skirkpatrick)\
**Post date:** [July 11, 2008, 9:06pm UTC](https://www.ruby-forum.com/t/gem-install-mysql/142824/2 "2008-07-11T21:06:06Z")

</div>

did you install build-essential and update?

sudo apt-get install build-essential  
sudo apt-get install update

i think you’ll need this one too:

sudo apt-get install libmysqlclient15-dev

---

<div class="post-metadata">

**Author:** ![skirkpatrick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/73ab20/32.png) [@skirkpatrick](https://www.ruby-forum.com/u/skirkpatrick)\
**Post date:** [July 11, 2008, 9:11pm UTC](https://www.ruby-forum.com/t/gem-install-mysql/142824/3 "2008-07-11T21:11:55Z")

</div>

just to be clearer, i recently installed the mysql gem in  
ubuntu 804 and this is what i had to install:

sudo apt-get install update  
sudo apt-get install build-essential  
sudo apt-get install mysql-server  
sudo apt-get install libmysqlclient15-dev  
sudo apt-get install libdbd-mysql-ruby

---

<div class="post-metadata">

**Author:** ![skirkpatrick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/73ab20/32.png) [@skirkpatrick](https://www.ruby-forum.com/u/skirkpatrick)\
**Post date:** [July 11, 2008, 9:15pm UTC](https://www.ruby-forum.com/t/gem-install-mysql/142824/4 "2008-07-11T21:15:40Z")

</div>

PP Junty wrote:

> just to be clearer, i recently installed the mysql gem in  
> ubuntu 804 and this is what i had to install:
> 
> sudo apt-get install update  
> sudo apt-get install build-essential  
> sudo apt-get install mysql-server  
> sudo apt-get install libmysqlclient15-dev  
> sudo apt-get install libdbd-mysql-ruby

ah ok thanks. i did do update and build-essential

do you think i should install libdbd-mysql-ruby or libdbd-mysql-ruby1.8

what version of ruby are you running ppjunty?

---

<div class="post-metadata">

**Author:** ![skirkpatrick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/73ab20/32.png) [@skirkpatrick](https://www.ruby-forum.com/u/skirkpatrick)\
**Post date:** [July 11, 2008, 9:27pm UTC](https://www.ruby-forum.com/t/gem-install-mysql/142824/5 "2008-07-11T21:27:30Z")

</div>

ruby 1.8:

sudo apt-get install ruby1.8 ruby1.8-dev rdoc1.8 ri1.8

i installed libdbd-mysql-ruby, don’t now what would be  
better.

> ah ok thanks. i did do update and build-essential
> 
> do you think i should install libdbd-mysql-ruby or libdbd-mysql-ruby1.8
> 
> what version of ruby are you running ppjunty?

---

<div class="post-metadata">

**Author:** ![skirkpatrick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/73ab20/32.png) [@skirkpatrick](https://www.ruby-forum.com/u/skirkpatrick)\
**Post date:** [July 12, 2008, 1:17am UTC](https://www.ruby-forum.com/t/gem-install-mysql/142824/6 "2008-07-12T01:17:44Z")

</div>

cool thanks i got it installed with that advice.

hmm…i have restarted my sql and apache, how do i know if i’m using the  
gem libraries for mysql or my original install libraries?

---

<div class="post-metadata">

**Author:** ![skirkpatrick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/73ab20/32.png) [@skirkpatrick](https://www.ruby-forum.com/u/skirkpatrick)\
**Post date:** [July 14, 2008, 4:41am UTC](https://www.ruby-forum.com/t/gem-install-mysql/142824/7 "2008-07-14T04:41:46Z")

</div>

rails will place the warning below in your log  
file if the mysql gem is not being used:

“WARNING: You’re using the Ruby-based MySQL library that  
ships with Rails. This library is not suited for production.  
Please install the C-based MySQL library instead (gem install mysql).”

Scott K. wrote:

> cool thanks i got it installed with that advice.
> 
> hmm…i have restarted my sql and apache, how do i know if i’m using the  
> gem libraries for mysql or my original install libraries?
