jwright9
asked on
Ruby error when trying to install mysql2 ruby gem
I am getting the error message: installing mysql2 (0.2.7) with native extensions
Gem::Installer::ExtensionB uildError: ERROR: Failed to build gem native extension. when the mysql2 gem is being built during a "bundle install". I appear to be missing a library or a header for the compilation. Can someone tell me how to fix this problem?
Using launchy (0.4.0)
Using linecache (0.43)
Using mongrel (1.1.5)
Installing mysql2 (0.2.7) with native extensions
Gem::Installer::ExtensionB uildError: ERROR: Failed to build gem native extension.
C:/Ruby187/bin/ruby.exe extconf.rb
checking for rb_thread_blocking_region( )... no
checking for main() in -llibmysql... 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=${op t-dir}/inc lude
--with-opt-lib
--without-opt-lib=${opt-di r}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/Ruby187/bin/ruby
--with-mysql-dir
--without-mysql-dir
--with-mysql-include
--without-mysql-include=${ mysql-dir} /include
--with-mysql-lib
--without-mysql-lib=${mysq l-dir}/lib
--with-libmysqllib
--without-libmysqllib
Gem files will remain installed in C:/Ruby187/lib/ruby/gems/1 .8/gems/my sql2-0.2.7 for inspection.
Results logged to C:/Ruby187/lib/ruby/gems/1 .8/gems/my sql2-0.2.7 /ext/mysql 2/gem_make .out
An error occured while installing mysql2 (0.2.7), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.2.7'` succeeds before bundling.
Gem::Installer::ExtensionB
Using launchy (0.4.0)
Using linecache (0.43)
Using mongrel (1.1.5)
Installing mysql2 (0.2.7) with native extensions
Gem::Installer::ExtensionB
C:/Ruby187/bin/ruby.exe extconf.rb
checking for rb_thread_blocking_region(
checking for main() in -llibmysql... 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=${op
--with-opt-lib
--without-opt-lib=${opt-di
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/Ruby187/bin/ruby
--with-mysql-dir
--without-mysql-dir
--with-mysql-include
--without-mysql-include=${
--with-mysql-lib
--without-mysql-lib=${mysq
--with-libmysqllib
--without-libmysqllib
Gem files will remain installed in C:/Ruby187/lib/ruby/gems/1
Results logged to C:/Ruby187/lib/ruby/gems/1
An error occured while installing mysql2 (0.2.7), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.2.7'` succeeds before bundling.
You need to install the mysql development tools, this can be done on Windows during the installation of MySQL, under Linux, just install the package 'mysql-devel'
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Solution worked.