Difficulties installing mysql gem on Ubuntu

I am trying to install gem mysql 2.8.1. I would use it to create a Rails 2.0.2 application on Ubuntu 10.04. I would use Ruby 1.8.7. I have installed development dependencies (other gems). For some reason I can not install it. I cannot figure out exactly how to fix this. Please, help!

I get the following in the terminal when I try to install it:

mohnish@pc146724-desktop:~/Downloads$ sudo gem install mysql-2.8.1.gem Building native extensions. This could take a while... ERROR: Error installing mysql-2.8.1.gem: ERROR: Failed to build gem native extension. /usr/bin/ruby1.8 extconf.rb 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 checking for main() in -lmygcc... 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: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/usr/bin/ruby1.8 --with-mysql-config --without-mysql-config --with-mysql-dir --without-mysql-dir --with-mysql-include --without-mysql-include=${mysql-dir}/include --with-mysql-lib --without-mysql-lib=${mysql-dir}/lib --with-mysqlclientlib --without-mysqlclientlib --with-mlib --without-mlib --with-mysqlclientlib --without-mysqlclientlib --with-zlib --without-zlib --with-mysqlclientlib --without-mysqlclientlib --with-socketlib --without-socketlib --with-mysqlclientlib --without-mysqlclientlib --with-nsllib --without-nsllib --with-mysqlclientlib --without-mysqlclientlib --with-mygcclib --without-mygcclib --with-mysqlclientlib --without-mysqlclientlib Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/mysql-2.8.1 for inspection. Results logged to /usr/lib/ruby/gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out mohnish@pc146724-desktop:~/Downloads$ 

Thanks for the help!

+46
mysql ruby-on-rails rubygems
Jan 6 2018-11-11T00:
source share
3 answers

Try this and then install mysql gem:

 sudo apt-get install libmysqlclient-dev 

If this is not enough, try to do it.

  sudo apt-get install libmysqlclient-dev libmysqlclient16 ruby-dev 
+116
Jan 06 2018-11-11T00:
source share

Try this and then install mysql gem:

sudo apt-get install libmysqlclient-dev libmysqlclient16

This worked after running sudo gem install mysql.

The documentation is still not installed correctly (heaps of "Undefined" errors, although this is not a very large option.

+9
Feb 15 '11 at 10:17
source share

You should do what the error message reports: check mkmf.log! Locate this file using find / usr / lib / ruby ​​/ gems / 1.8 / gems / -name mkmf.log. Usually this error message appears because you forgot to install the -dev package for the extension you tried to install. Therefore, if you want to install gsm mysql, you probably forgot to install libmysqlclient14-dev first. Search apt-cache | grep dev to find matching packages.

plz check this for more information

+2
Jan 06 2018-11-11T00:
source share



All Articles