LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Error while installing MySQL Ruby gem (https://www.linuxquestions.org/questions/programming-9/error-while-installing-mysql-ruby-gem-739581/)

skie_knite007 07-12-2009 02:55 PM

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

skie_knite007 07-12-2009 03:00 PM

The version

Quote:

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




repo 07-12-2009 03:11 PM

You're missing the ruby header files,
Try
Code:

sudo yum install ruby-devel

skie_knite007 07-12-2009 03:17 PM

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.






repo 07-12-2009 03:28 PM

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

skie_knite007 07-12-2009 06:57 PM

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


All times are GMT -5. The time now is 07:09 AM.