Error Installing Mysql2 Gem
have one accepted answer. Are you sure you want to replace the current answer with this one? Yes, I'm sure. Changed your mind? You previously marked this answer as accepted. Are you sure you want to unaccept it? Yes, I'm sure. Sign Up Log In submit Tutorials Questions Projects Meetups Main Site logo-horizontal DigitalOcean Community Menu Tutorials Questions Projects Meetups Main Site Sign Up Log In submit View All Results By: lucashesg Subscribe Subscribed Share 0 gem install mysql2 failed on on Ubuntu 14.04 September 10, 2014 15.1k views ~# gem install mysql2 Building native extensions. This could take a while... ERROR: Error installing mysql2: ERROR: Failed to build gem native extension. /usr/local/rvm/rubies/ruby-2.0.0-p353/bin/ruby extconf.rb Gem files will remain installed in /usr/local/rvm/gems/ruby-2.0.0-p353/gems/mysql2-0.3.16 for inspection. I google and tried the below but still the same error. Pleas help! Thank you! sudo apt-get install mysql-client libmysqlclient-dev 2 comments 0 wavrin September 10, 2014 Maybe run this update first: sudo gem update --system 0 abe.petrillo September 10, 2014 Might be worth upgrading ruby to 2.1.2, I heard it's a bit more stable. Is there no more output? Also with checking if you have make: apt-get install make Log In to Comment Leave a Comment Add comments here to get more clarity or context around a question. To answer a question, use the “Answer” field below. Log In to Comment 6 Answers 3 asb MOD September 10, 2014 It looks like you are probably missing something needed to compile the mysql2 gem's C extension. Try installing the following packages: sudo apt-get install build-essential libmysqlclient-dev Reply Log In to Comment 0 lucashesg September 10, 2014 Hi wavrin, asb, thanks for your answer. However, I still have the same error after running your commands. would appreciate if anyone can give suggestion on how to setup mysql2 on Ubuntu 14.04. It is a new droplet that i just created yesterday. I guess you can reproduce this by creating a new temporary droplet Ubuntu 14.04 with ruby and rails Reply Log In to Comment 0 bonnet.benjamin November 21, 2014 thanks for the tips Reply Log In to Comment 0 Thelastinuit January 16, 2015 sudo apt-get install mysql-server libmysqlclient-dev Works for me. Reply Log In to Comment 0 kradllit April 11, 2015 Also need to install ruby2.*-dev Reply Log In to Comment 0 romariolopezc June 29, 2015 sudo apt-get install build-essential libmysqlclient-dev works for me! thanks Reply Log In to Comment Have another answer? Share your knowledge. Log In to Answer Copyright © 2016 DigitalOcean™ Inc. Community Tutorials Questions Pro
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of https://www.digitalocean.com/community/questions/gem-install-mysql2-failed-on-on-ubuntu-14-04 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Ruby gem mysql2 install failing up vote 62 down vote favorite 32 When I try to install the mysql2 gem, it fails with no apparent errors. Does anyone know what to do to work around this so http://stackoverflow.com/questions/4115126/ruby-gem-mysql2-install-failing mysql2 installs? Tanner-Smiths-MacBook-Pro:Humans_vs_Zombies_Parse tanner$ sudo gem install mysql2Building native extensions. This could take a while... ERROR: Error installing mysql2: ERROR: Failed to build gem native extension. /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb checking for rb_thread_blocking_region()... no 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... no 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=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/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 --witho
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this http://stackoverflow.com/questions/27832120/error-error-installing-mysql2-error-failed-to-build-gem-native-extension site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x https://github.com/brianmario/mysql2/issues/364 Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up ERROR: Error error installing installing mysql2: ERROR: Failed to build gem native extension up vote 7 down vote favorite 1 I am having some problems when trying to install gem install mysql2 -v '0.3.17' for Rails. When I try to install it by running gem install mysql2 -v '0.3.17' or gem install mysql2 -v '0.3.17' it gives me the following error: ERROR: Error installing mysql2: ERROR: Failed to error installing mysql2 build gem native extension. Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the file for more details. You may need configuration options. Provided configuration options: --with-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 --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-mysql-config --without-mysql-config Gem files will remain installed in `..../gems/ruby-1.9.3-p392/gems/mysql2-0.3.17 for inspection`. Results logged to `.../gems/ruby-1.9.3-p392/extensions/x86_64-darwin-14/1.9.1/mysql2-0.3.17/gem_make.out` How can I fix this and successfully install mysql2? Thanks all . mysql ruby-on-rails ruby ruby-on-rails-3 gem share|improve this question edited Jan 8 '15 at 3:02 Prakash Murthy 9,65132046 asked Jan 8 '15 at 2:40 Thanh Khiet Nguyen 3614 Could you include the contents of the .../gems/ruby-1.9.3-p392/extensions/x86_64-darwin-14/1.9.1/mysql2-0.3.17/gem_make.out file. It is shown in the last line of the error message as Results logged to.. –Prakash Murthy Jan 8 '15 at 3:03 This should help : stackoverflow.com/questions/4115126/… –Prakash Murthy Jan 8 '15 at 3:09 add a comment| 4 Answers 4 active oldest votes up vote 7 down vote Install libmysqlclient-devel: CentOS/Fedora: yum install -y libmysqlclient-devel Ubuntu: apt-get install -y libmysqlclient-dev Mac: brew install mysql Hope it helps. share|improve this answer answered Jan 8 '15 at 3:28 bestmike
Sign in Pricing Blog Support Search GitHub This repository Watch 77 Star 1,520 Fork 342 brianmario/mysql2 Code Issues 42 Pull requests 18 Projects 0 Pulse Graphs New issue Error installing mysql2, Failed to build gem native extension. On Win XP with Ruby 2.0.0. #364 Closed wzup opened this Issue Mar 24, 2013 · 29 comments Projects None yet Labels None yet Milestone 0.3.14 Assignees No one assigned 19 participants wzup commented Mar 24, 2013 I cannot install the gem. I have pre-installed MySQL here, no any spaces in the path: C:\mysql-5.6.10\mysql-5.6.10-win32 I have Ruby 2.0.0 from RubyInstaller. The command I type: C:\>gem install mysql2 --platform=ruby -- --with-mysql-dir="C:\mysql-5.6.10\mysql-5.6.10-win32" Readme.md says: If you have installed MySQL to a non-standard location, add gem install mysql2 --with-mysql-config=/some/random/path/bin/mysql_config What is /some/random/path/bin/mysql_config? I don't have any mysql_config file in bin/ directory of my MySQL installation. Could you explain what config is meant? A copy/paste part from the error message: ERROR: Error installing mysql2: ERROR: Failed to build gem native extension. C:/Ruby200/bin/ruby.exe extconf.rb --with-mysql-dir=C:\mysql-5.6.10\mysql-5.6.10-win32 checking for rb_thread_blocking_region()... *** 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=C:/Ruby200/bin/ruby What do all those configuration options mean? Do I have to pass any values with them for successful installation? Readme.md file doesn't provide info about them. Where may I find explanation? How to solve the issue? Is it even possible to install the gem on Win XP? jopich commented Mar 27, 2013 +1 for me during redmine installation process. I am under windows XP with Ruby 2.0.0 and DevKit installed as well. I use Wamp server for mysql. - when I try to do the "