LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 07-12-2009, 02:55 PM   #1
skie_knite007
Member
 
Registered: Dec 2004
Location: India
Distribution: Fedora Core 4
Posts: 145

Rep: Reputation: 15
Thumbs down Error while installing MySQL Ruby gem


Hi,

I am getting the below error when tried to install mysql gem.

Quote:

# gem install mysql
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.

/usr/bin/ruby extconf.rb install mysql
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






I use Fedore Core 10. Please help in resolving this error
 
Old 07-12-2009, 03:00 PM   #2
skie_knite007
Member
 
Registered: Dec 2004
Location: India
Distribution: Fedora Core 4
Posts: 145

Original Poster
Rep: Reputation: 15
The version

Quote:
#ruby -v
ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-linux]


 
Old 07-12-2009, 03:11 PM   #3
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Linux Mint
Posts: 8,498

Rep: Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883
You're missing the ruby header files,
Try
Code:
sudo yum install ruby-devel
 
Old 07-12-2009, 03:17 PM   #4
skie_knite007
Member
 
Registered: Dec 2004
Location: India
Distribution: Fedora Core 4
Posts: 145

Original Poster
Rep: Reputation: 15
I tried that . Now, I got a new error

Quote:
# gem install mysql
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.

/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... 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.




 
Old 07-12-2009, 03:28 PM   #5
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Linux Mint
Posts: 8,498

Rep: Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883
Quote:
Check the mkmf.log file for more
details. You may need configuration options.
Did you looked ?
Try
Code:
gem install mysql -- --with-mysql-dir=path_to_mysql

Did you installed the mysql dev library?
libmysqlclient15-dev
 
Old 07-12-2009, 06:57 PM   #6
skie_knite007
Member
 
Registered: Dec 2004
Location: India
Distribution: Fedora Core 4
Posts: 145

Original Poster
Rep: Reputation: 15
Thumbs up

Thanks buddy.

The devel lib was missing. I downloaded the below rpm and the gem got installed successfully..

Quote:

]# rpm -ivh MySQL-shared-3.23.57-1.i386.rpm
Preparing... ########################################### [100%]
1:MySQL-shared ########################################### [100%]
[root@localhost Download]# gem install mysql
Building native extensions. This could take a while...
Successfully installed mysql-2.7
1 gem installed


Once again thanks
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Any issues installing Ruby Gems and Ruby on Rails in Slackware? Lufbery Slackware 8 02-09-2011 07:22 PM
Help needed installing Ruby MySQL DBI bostonantifan Linux - Software 1 11-12-2007 04:03 AM
Help needed installing Ruby MySQL DBI bostonantifan Ubuntu 0 11-11-2007 09:35 AM
Runtime Error Installing Ruby 1.8.5 Muraii Linux - Software 2 01-16-2007 07:19 PM
Installing ruby with rails+mysql+apache on Slackware 10.2 from source paultoytoy Slackware 1 09-08-2006 12:01 PM


All times are GMT -5. The time now is 10:20 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration