mysql - ruby mysql2 gem install error -


i having problems installing mysql2 gem on windows machine, worked, failed build native extension. googled around, there lot of linux fixes. know not best thing work on windows ruby. problem, used gem install mysql2 -- --with-mysql-dir=c:\wamp\bin\mysql\mysql5.6.12\bin --with-mysql-lib=c:\wamp\bin\mysql\mysql5.6.12\lib install mysql2, works mysql, rails requires mysql2.

thank you.

mysql2 can tricky install. got dev box working ruby 2.0.0p247, windows 64bit , mysql 0.3.13. here suggestions:

  1. make sure have latest devkit installed (http://rubyinstaller.org/downloads/). on right column of page, tells version of devkit you'll need particular version of ruby. we've found easiest install c:\devkit

  2. now try , run gem install mysql2 ... command listed in question. alternatively, 32bit installs do:

 subst x: "c:\program files (x86)\mysql\mysql server 5.6" gem install mysql2 -v=0.3.13 --platform=ruby -- --with-mysql-include=x:\include --with-mysql-lib=x:\lib subst x: /d 

the subst command creates virtual drive , helps spaces in path name.

  1. copy c:\program files (x86)\mysql\mysql server 5.6\lib\libmysql.dll ruby bin directory. should off , running if you're working 32bit.

64bit users run bug once mysql2 build. above steps appear work, when go use mysql2 gem useful, run rake db:create, segmentation fault. more info , fix issue can found @ https://github.com/brianmario/mysql2/issues/372, https://bugs.ruby-lang.org/issues/8591, https://groups.google.com/forum/#!topic/rubyinstaller/utnffot6yqo

long story short, compatible mysql connector c needs used instead of mysql server directory. helpful user provided right connector c , can downloaded here (https://www.copy.com/s/chz4et4us6f1/mysql-connector-c-noinstall-6.0.2-winx64.zip). extract zip file, , point gem install mysql2 ... command appropriate directories , 64bit happiness follow. (don't forget grab libmysql.dll downloaded connector c folder , place in ruby bin directory).


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -