Facing error installing mysql2 gem
Asked Answered
P

3

2

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

Pescara answered 1/11, 2011 at 14:4 Comment(2)
you didn't post important part which is before posted codeStegosaur
@Stegosaur I have added that, please check nowPescara
P
2

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

Plusch answered 23/12, 2011 at 13:5 Comment(0)
C
2

This should solve your problem

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

gem install mysql2
Conveyancing answered 25/12, 2014 at 21:36 Comment(0)
J
0

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

Jolyn answered 23/12, 2011 at 12:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.