mysql - ...mysql2/mysql2.so: [BUG] Segmentation fault ruby 2.0.0p247 -
i'm using windows7x64, ruby2.0.0p247, rails4.0.0 , mysql5.5.27.
when run $ rails server
command, got following error.
c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/mysql2-0.3.13/lib/mysql2/mysql2.so: [bug] segmentation fault ruby 2.0.0p247 (2013-06-27) [x64-mingw32]
how can rid of error?
the libmysql.lib included in mysql connector/c 64 bit not compatible mingw64-gcc compiler.
you need generate mingw64 compatible libmysql.lib file.
to generate libmysql.lib file, need gendef.exe, can obtain mingw-w64 distribution(i got https://code.google.com/p/structure-svm-map/downloads/detail?name=svm-map-win.zip&can=2&q=)
in lib folder of mysql connector, produce libmysql.lib following steps.
gendef.exe libmysql.dll
dlltool -v --dllname libmysql.dll --def libmysql.def --output-lib libmysql.lib
and running normal gem install command. gem install mysql2 -v '0.3.12b6' -- --with-opt-dir="..."
note: in case of mysql connector/c 6.1, due version comparison routine, cannot use mysql2 module following exception. runtimeerror: incorrect mysql client library version! gem compiled 5.7.2-m12 client library 6.1.0.
you should use mysql-connector-c-6.0.2-winx64.msi in http://dev.mysql.com/downloads/connector/c/6.0.html#downloads
Comments
Post a Comment