2
votes

Rails ask me to succeed with gem install mysql2 and on trying I got the following error.So what is mostly problem with such error? Detail of error is below: 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/local/bin/ruby
--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/local/lib/ruby/gems/1.9.1/gems/mysql2-0.3.7 for  inspection.
   Results logged to /usr/local/lib/ruby/gems/1.9.1/gems/mysql2-0.3.7/ext/mysql2/gem_make.out

This error occured in the result of

       sudo gem install mysql2

Is there any problem in installation of mysql? Please tell whatever you know about that, I really appreciate your spent time on reading my question.

thanks

3
you didn't post important part which is before posted codeBohdan
@Bohdan I have added that, please check nowHafiz

3 Answers

2
votes

if you have not installed mysql try adding the following full packages:

sudo apt-get install mysql-server mysql-server-5.1 libmysql-ruby libmysqlclient-dev mysql-client-5.1 mysql-common

Also checkout this heroku db:pull cant connect to my DB in ubuntu

2
votes

This should solve your problem

sudo apt-get install libmysqld-dev libmysqlclient-dev mysql-client

gem install mysql2
0
votes

I had a lot of problems installing Rails and especially mysql first time around... try reading this post: Error installing mysql2: Failed to build gem native extension