# Trouble installing mysql gem

**URL:** <https://discuss.rubyonrails.org/t/trouble-installing-mysql-gem/37627>\
**Category:** rubyonrails-talk\
**Created:** [December 23, 2008, 1:44am UTC](https://discuss.rubyonrails.org/t/trouble-installing-mysql-gem/37627 "2008-12-23T01:44:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bryce\_Roney](https://avatars.discourse-cdn.com/v4/letter/b/3bc359/32.png) [@Bryce\_Roney](https://discuss.rubyonrails.org/u/Bryce_Roney)\
**Post date:** [December 23, 2008, 1:44am UTC](https://discuss.rubyonrails.org/t/trouble-installing-mysql-gem/37627/1 "2008-12-23T01:44:24Z")

</div>

Hello,

I'm having trouble installing the mysql gem, here is the error I am getting:

Building native extensions. This could take a while... ERROR: Error installing mysql: &nbsp;&nbsp;ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby 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... no 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.

Provided configuration options: &nbsp;&nbsp;--with-opt-dir &nbsp;&nbsp;--without-opt-dir &nbsp;&nbsp;--with-opt-include &nbsp;&nbsp;--without-opt-include=${opt-dir}/include &nbsp;&nbsp;--with-opt-lib &nbsp;&nbsp;--without-opt-lib=${opt-dir}/lib &nbsp;&nbsp;--with-make-prog &nbsp;&nbsp;--without-make-prog &nbsp;&nbsp;--srcdir=. &nbsp;&nbsp;--curdir &nbsp;&nbsp;--ruby=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby &nbsp;&nbsp;--with-mysql-config &nbsp;&nbsp;--without-mysql-config &nbsp;&nbsp;--with-mysql-dir &nbsp;&nbsp;--without-mysql-dir &nbsp;&nbsp;--with-mysql-include &nbsp;&nbsp;--without-mysql-include=${mysql-dir}/include &nbsp;&nbsp;--with-mysql-lib &nbsp;&nbsp;--without-mysql-lib=${mysql-dir}/lib &nbsp;&nbsp;--with-mysqlclientlib &nbsp;&nbsp;--without-mysqlclientlib &nbsp;&nbsp;--with-mlib &nbsp;&nbsp;--without-mlib &nbsp;&nbsp;--with-mysqlclientlib &nbsp;&nbsp;--without-mysqlclientlib &nbsp;&nbsp;--with-zlib &nbsp;&nbsp;--without-zlib &nbsp;&nbsp;--with-mysqlclientlib &nbsp;&nbsp;--without-mysqlclientlib &nbsp;&nbsp;--with-socketlib &nbsp;&nbsp;--without-socketlib &nbsp;&nbsp;--with-mysqlclientlib &nbsp;&nbsp;--without-mysqlclientlib &nbsp;&nbsp;--with-nsllib &nbsp;&nbsp;--without-nsllib &nbsp;&nbsp;--with-mysqlclientlib &nbsp;&nbsp;--without-mysqlclientlib

Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/mysql-2.7 for inspection. Results logged to /Library/Ruby/Gems/1.8/gems/mysql-2.7/gem\_make.out Macintosh:~ bryce$

---

<div class="post-metadata">

**Author:** ![Tom10](https://avatars.discourse-cdn.com/v4/letter/t/cc9497/32.png) [@Tom10](https://discuss.rubyonrails.org/u/Tom10)\
**Post date:** [December 23, 2008, 9:41pm UTC](https://discuss.rubyonrails.org/t/trouble-installing-mysql-gem/37627/2 "2008-12-23T21:41:17Z")

</div>

Do you have the XCode installed?

---

<div class="post-metadata">

**Author:** ![Timothy\_N\_Tsvetkov](https://avatars.discourse-cdn.com/v4/letter/t/f6c823/32.png) [@Timothy\_N\_Tsvetkov](https://discuss.rubyonrails.org/u/Timothy_N_Tsvetkov)\
**Post date:** [December 24, 2008, 11:03am UTC](https://discuss.rubyonrails.org/t/trouble-installing-mysql-gem/37627/3 "2008-12-24T11:03:12Z")

</div>

try: sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/ bin/mysql\_config (I have mysql\_config here in my MacOS X, maybe you have it in some other place)
