mysql - gem install mysql2 fails -


i got error:

sudo gem install mysql2 building native extensions.  take while... error:  error installing mysql2:     error: failed build gem native extension.  /usr/bin/ruby1.8 extconf.rb checking rb_thread_blocking_region()... no checking mysql.h... no checking mysql/mysql.h... no ----- mysql.h missing.  please check installation of mysql , try again. ----- *** extconf.rb failed *** not create makefile due reason, lack of necessary libraries and/or headers.  check mkmf.log file more details.  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   gem files remain installed in /var/lib/gems/1.8/gems/mysql2-0.2.6 inspection. results logged /var/lib/gems/1.8/gems/mysql2-0.2.6/ext/mysql2/gem_make.out 

i have tried:

  • uninstall mysql2 , install again
  • uninstall mysql apt-get
  • installd dev-tools mysql
  • and pages on google

how can fix this?

you need install libmysqlclient-dev before installing mysql2 gem:

sudo apt-get install libmysqlclient-dev gem install mysql2 

this should fix problem on latest ubuntu versions.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -