Question

(as an aside its telling me I have code in here and have to format it as such, so if anything looks strange its because it wouldn't let me post it otherwise.)

I've actually reinstalled windows 8 three times in the last two days and actually created a dual boot with Ubuntu with how frustrating this problem has been. (decided learning a whole new operating system was more annoying then trying to fix the windows problem)

So, i'm new to coding in general, but I've been fooling around with ruby and rails and decided to try and get the database stuff working and every time I run into the same sorts of problems, this seems to be some sort of windows 64 bit MySQL ruby version confusion.
I'm using windows 6.1 64 with ruby 2.0.0p353 (2013-11-22) [x64-mingw32] rails 4.0.2 with MySQL 5.6

I've installed the devkit and did the test using  ruby -rubygems -e "require 'json'; puts JSON.load('[42]').inspect" and it returned 42 and that whole installation seemed to go fine.

rails installed ruby installed, all -v showing the version I listed.

now when I go to install MySQL gem it gives me this.

Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing mysql:
        ERROR: Failed to build gem native extension.

    C:/Ruby200-x64/bin/ruby.exe extconf.rb
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.

I read up and tried doing this after installing the MySQL c connector.  And it returns as follows.

C:\Users\ryan>gem install mysql2 --platform=ruby -- '--with-mysql-dir="C:/mysql-
connector-c-6.1.3-win32/"'
Temporarily enhancing PATH to include DevKit...
Building native extensions with: '--with-mysql-dir="C:/mysql-connector-c-6.1.3-w
in32/"'
This could take a while...
ERROR:  Error installing mysql2:
        ERROR: Failed to build gem native extension.

    C:/Ruby200-x64/bin/ruby.exe extconf.rb --with-mysql-dir="C:/mysql-connector-
c-6.1.3-win32/"
checking for ruby/thread.h... yes
checking for rb_thread_call_without_gvl() in ruby/thread.h... yes
checking for rb_thread_blocking_region()... yes
checking for rb_wait_for_single_fd()... yes
checking for rb_hash_dup()... yes
checking for rb_intern3()... yes
-----
Cannot find include dir at C:/mysql-connector-c-6.1.3-win32//include
-----
*** 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.



I have devoted days to this problem, and reinstalled more things than I care to admit.  Does anyone have any ideas how I could possibly fix this... ?

ok this is what its spitting out now..

C:\Users\ryan>gem install mysql --platform=ruby -- --with-mysql-dir=c:\mysql-con nector-c-6.1.3-win32 Temporarily enhancing PATH to include DevKit... Building native extensions with: '--with-mysql-dir=c:\mysql-connector-c-6.1.3-wi n32' This could take a while... ERROR: Error installing mysql: ERROR: Failed to build gem native extension.

C:/Ruby200-x64/bin/ruby.exe extconf.rb --with-mysql-dir=c:\mysql-connector-c

-6.1.3-win32 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=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=C:/Ruby200-x64/bin/ruby --with-mysql-dir --with-mysql-include --without-mysql-include=${mysql-dir}/include --with-mysql-lib --without-mysql-lib=${mysql-dir}/ --with-libmysqllib --without-libmysqllib

Gem files will remain installed in C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/mysql -2.9.1 for inspection. Results logged to C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/mysql-2.9.1/ext/mysql_ api/gem_make.out

Was it helpful?

Solution

gave up and installed windows 7 32 bit on a second harddrive and just use that for rails stuff.

Set that up using an amazing video on youtube I randomly found, but it worked perfectly.

https://www.youtube.com/watch?feature=player_embedded&v=-eFwV8lRu1w

no joke I was close to giving up! It seems like lots of rails problems are oriented around 64 bit windows anyway, but 8.1 can't be helping anything.

It's almost a silly answer to say just give up, and i'm sure its possible to get the most recent version of rails and ruby working on windows 8.1 64 right at this moment, but I think with the effort required it is actually easier for a new person to just install a 32 bit version of, preferably, an earlier version of windows.

OTHER TIPS

I had faced same issue. You can find solution here. http://blog.mmediasys.com/2011/07/07/installing-mysql-on-windows-7-x64-and-using-ruby-with-it/

Here in the blog a invalid path for mysql-connector-c-noinstall-6.0.2-win32

gem install mysql --platform=ruby -- --with-mysql-dir=C:/mysql-connector-c-noinstall-6.0.2-win32

So for this you have to check your folder structure for mysql-connector then use it.

Thanks

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top