# Failed to build gem native extension.(mysql)

**URL:** <https://www.ruby-forum.com/t/failed-to-build-gem-native-extension-mysql/104035>\
**Category:** Rails\
**Created:** [May 13, 2007, 9:10am UTC](https://www.ruby-forum.com/t/failed-to-build-gem-native-extension-mysql/104035 "2007-05-13T09:10:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thufir](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ee7513/32.png) [@Thufir](https://www.ruby-forum.com/u/Thufir)\
**Post date:** [May 13, 2007, 9:10am UTC](https://www.ruby-forum.com/t/failed-to-build-gem-native-extension-mysql/104035/1 "2007-05-13T09:10:59Z")

</div>

I’m trying to install the mysql gem. I have mysql up and running,  
everything is up to date through yum.

[root@localhost ~]#  
[root@localhost ~]# gem install mysql -y  
Select which gem to install for your platform (i386-linux)

1. mysql 2.7.3 (mswin32)
2. mysql 2.7.1 (mswin32)
3. mysql 2.7 (ruby)
4. mysql 2.6 (ruby)
5. Skip this gem
6. Cancel installation

> 3  
> Building native extensions. This could take a while…  
> ERROR: While executing gem … (Gem::Installer::ExtensionBuildError)  
> ERROR: Failed to build gem native extension.

ruby extconf.rb install mysql -y  
can’t find header files for ruby.

Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/mysql-2.7  
for inspection.  
Results logged to /usr/lib/ruby/gems/1.8/gems/mysql-2.7/gem\_make.out  
[root@localhost ~]#  
[root@localhost ~]# cat /etc/fedora-release  
Fedora Core release 6 (Zod)  
[root@localhost ~]#  
[root@localhost ~]# date  
Sun May 13 08:01:18 BST 2007  
[root@localhost ~]#  
[root@localhost ~]#

thanks,

Thufir

---

<div class="post-metadata">

**Author:** ![Thufir](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ee7513/32.png) [@Thufir](https://www.ruby-forum.com/u/Thufir)\
**Post date:** [May 13, 2007, 9:15pm UTC](https://www.ruby-forum.com/t/failed-to-build-gem-native-extension-mysql/104035/2 "2007-05-13T21:15:11Z")

</div>

> From FC6 (fedora), this is how the mysql gem is installed?

[root@localhost ~]#  
[root@localhost ~]#  
[root@localhost ~]#  
[root@localhost ~]# yum -y install ruby-mysql.i386  
Loading “installonlyn” plugin  
Setting up Install Process  
Setting up repositories  
Reading repository metadata in from local files  
Parsing package install arguments  
Nothing to do  
[root@localhost ~]# yum search ‘ruby-mysql’  
Loading “installonlyn” plugin  
Setting up repositories  
Reading repository metadata in from local files

ruby-mysql.i386 2.7.1-2.fc6  
extras  
Matched from:  
ruby-mysql

ruby-mysql.i386 2.7.1-2.fc6  
installed  
Matched from:  
ruby-mysql  
You have new mail in /var/spool/mail/root  
[root@localhost ~]#  
[root@localhost ~]# date  
Sun May 13 20:10:19 BST 2007  
[root@localhost ~]#

thanks,

Thufir
