[ gem ] bundle install mysql; checking for mysql_query() in -lmysqlclient… no

problem

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:/home/pong/.rvm/gems/ruby-2.1.2@toaster/gems/mysql2-0.3.18/ext/mysql2/home/pong/.rvm/rubies/ruby-2.1.2/bin/ruby -r ./siteconf20171017-2320-19gfum4.rbextconf.rbchecking for ruby/thread.h... yeschecking for rb_thread_call_without_gvl() in ruby/thread.h... yeschecking for rb_thread_blocking_region()... yeschecking for rb_wait_for_single_fd()... yeschecking for rb_hash_dup()... yeschecking for rb_intern3()... yeschecking for mysql_query() in -lmysqlclient... nochecking for main() in -lm... yeschecking for mysql_query() in -lmysqlclient... nochecking for main() in -lz... yeschecking for mysql_query() in -lmysqlclient... nochecking for main() in -lsocket... nochecking for mysql_query() in -lmysqlclient... nochecking for main() in -lnsl... yeschecking for mysql_query() in -lmysqlclient... nochecking for main() in -lmygcc... nochecking for mysql_query() in -lmysqlclient... no*** extconf.rb failed ***Could not create Makefile due to some reason, probably lack of necessarylibraries and/or headers.  Check the mkmf.log file for more details.  You mayneed 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=/home/pong/.rvm/rubies/ruby-2.1.2/bin/ruby --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 --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
To see why this extension failed to compile, please check the mkmf.log which canbe found here:
/home/pong/.rvm/gems/ruby-2.1.2@toaster/extensions/x86_64-linux/2.1.0/mysql2-0.3.18/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in/home/pong/.rvm/gems/ruby-2.1.2@toaster/gems/mysql2-0.3.18 for inspection.Results logged to/home/pong/.rvm/gems/ruby-2.1.2@toaster/extensions/x86_64-linux/2.1.0/mysql2-0.3.18/gem_make.out
An error occurred while installing mysql2 (0.3.18), and Bundler cannotcontinue.Make sure that `gem install mysql2 -v '0.3.18'` succeeds before bundling.
In Gemfile:  mysql2

solution

sudo apt-get install libmysqlclient-dev

ref: https://stackoverflow.com/questions/5795309/gem-install-mysql-fail

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s