0

I have recently installed Ruby in my Windows machine and trying to setup in localhost a project that is built in Sinatara framework. For this I need to run few commands like below.

  1. gem install bundle
  2. bundle install

The first command executed without any issue. When I tried to execute second command, it throws below error after a while.

Installing do_mysql 0.10.16 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

C:/Ruby22-x64/bin/ruby.exe -r ./siteconf20150808-5540-i2wwjw.rb extconf.rb

creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
generating do_mysql-x64-mingw32.def
compiling do_common.c
compiling do_mysql.c
do_mysql.c:5:19: fatal error: mysql.h: No such file or directory
compilation terminated.
make: *** [do_mysql.o] Error 1

make failed, exit code 2

Gem files will remain installed in C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/do_mys
ql-0.10.16 for inspection.
Results logged to C:/Ruby22-x64/lib/ruby/gems/2.2.0/extensions/x64-mingw32/2.2.0
/do_mysql-0.10.16/gem_make.out
An error occurred while installing do_mysql (0.10.16), and Bundler cannot
continue.
Make sure that `gem install do_mysql -v '0.10.16'` succeeds before bundling.

As the above error sugested me to run "gem install do_mysql -v '0.10.16'", I did and again got same error. I have attached the error below.

C:\Users\binoy\live>gem install do_mysql -v '0.10.16'
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing do_mysql:
ERROR: Failed to build gem native extension.

C:/Ruby22-x64/bin/ruby.exe -r ./siteconf20150808-9876-odu2ng.rb extconf.rb
checking for my_global.h... no
checking for mysql.h... no
checking for main() in -llibmysql... no
checking for mysql_query() in mysql.h... no
checking for mysql_ssl_set() in mysql.h... no
checking for localtime_r()... yes
checking for gmtime_r()... yes
checking for mysql.h... no
checking for MYSQL_TYPE_STRING in mysql.h... no
checking for MYSQL_TYPE_BIT in mysql.h... no
checking for MYSQL_TYPE_NEWDECIMAL in mysql.h... no
checking for mysql_query() in mysql.h... no
checking for mysql_ssl_set() in mysql.h... no
checking for mysql_sqlstate() in mysql.h... no
checking for mysql_get_ssl_cipher() in mysql.h... no
checking for mysql_set_character_set() in mysql.h... no
checking for mysql_get_server_version() in mysql.h... no
checking for MYSQL_FIELD.charsetnr in mysql.h... no
checking for rb_thread_fd_select()... yes
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
generating do_mysql-x64-mingw32.def
compiling do_common.c
compiling do_mysql.c
do_mysql.c:5:19: fatal error: mysql.h: No such file or directory
compilation terminated.
make: *** [do_mysql.o] Error 1

make failed, exit code 2

Gem files will remain installed in C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/do_mys
ql-0.10.16 for inspection.
Results logged to C:/Ruby22-x64/lib/ruby/gems/2.2.0/extensions/x64-mingw32/2.2.0
/do_mysql-0.10.16/gem_make.out

I got stuck here. I will really appreciate your help. Thanks, Binoy

  • Possible duplicate: http://stackoverflow.com/questions/8164926/is-datamappers-dm-mysql-adapter-gem-supported-on-windows/ – Casper Aug 08 '15 at 17:16
  • Thanks @Casper. Will take a look at the link. – user3282038 Aug 08 '15 at 17:26
  • @Casper, I followed the link but still have the same error. Not sure why? Do you have any other info for me ? I really appreciate your response. – user3282038 Aug 08 '15 at 21:12
  • Did you install the DevKit too? https://github.com/oneclick/rubyinstaller/wiki/Development-Kit – Casper Aug 08 '15 at 21:24
  • Yes. I have already installed DevKit. – user3282038 Aug 09 '15 at 02:05
  • @Casper I have downloaded "do_mysql-0.10.16-x86-mswin32-60.gem" from this link https://rubygems.org/gems/do_mysql/versions after following your link. But not sure how I should run/execute this .gem file. Do you have any suggestion for me ? – user3282038 Aug 09 '15 at 02:20
  • Ok I see. First you can try `gem install do_mysql -v '0.10.16' --platform x86-mswin32-60`, maybe that resolve the issue completely. Otherwise you can try `gem install --local do_mysql-0.10.16-x86-mswin32-60.gem`. – Casper Aug 09 '15 at 13:10
  • The problem is you're running a 64-bit version of Ruby, while those are 32-bit binaries. But you can try and see if it works. – Casper Aug 09 '15 at 13:14
  • @Casper I have run the command metioned in your earlier comment but doesn't seem to work. Yes. I think so the issue is because of 32-bit binaries. – user3282038 Aug 10 '15 at 20:12
  • Right now I have installed Ubuntu in VM over my windows and I have setup the project in my localhost successfully. Thanks for your time @Casper – user3282038 Aug 10 '15 at 20:13
  • Ok that's good that you got it working even though it's on a VM. You could also install the 32-bit version of Ruby, and get it working on Windows that way (uninstall the 64-bit first). – Casper Aug 10 '15 at 22:15
  • @Casper sure, in a later date will try to uninstall 64-bit of ruby and install 32-bit to see if it works. – user3282038 Sep 21 '15 at 10:16

0 Answers0