简体   繁体   English

... mysql2 / mysql2.so:[BUG]分段错误ruby 2.0.0p247

[英]…mysql2/mysql2.so: [BUG] Segmentation fault ruby 2.0.0p247

I'm using windows7x64, ruby2.0.0p247, rails4.0.0 and mysql5.5.27. 我使用的是windows7x64,ruby2.0.0p247,rails4.0.0和mysql5.5.27。
When I run the $ rails server command, I got the following error. 当我运行$ rails server命令时,出现以下错误。

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 I get rid of this error? 我怎样才能摆脱这个错误?

The libmysql.lib included in the MySQL Connector/C 64 bit is not compatible with the mingw64-gcc compiler. MySQL Connector / C 64位中包含的libmysql.lib与mingw64-gcc编译器不兼容。

You need to generate mingw64 compatible libmysql.lib file. 您需要生成mingw64兼容的libmysql.lib文件。

To generate libmysql.lib file, you need gendef.exe, which can obtain from mingw-w64 distribution(I got from https://code.google.com/p/structure-svm-map/downloads/detail?name=svm-map-win.zip&can=2&q= ) 要生成libmysql.lib文件,您需要gendef.exe,它可以从mingw-w64发行版获得(我来自https://code.google.com/p/structure-svm-map/downloads/detail?name=svm -map-win.zip&can = 2&q =

In the lib folder of the mysql connector, produce libmysql.lib with the following steps. 在mysql连接器的lib文件夹中,使用以下步骤生成libmysql.lib。

gendef.exe libmysql.dll gendef.exe libmysql.dll

dlltool -v --dllname libmysql.dll --def libmysql.def --output-lib libmysql.lib dlltool -v --dllname libmysql.dll --def libmysql.def --output-lib libmysql.lib

And running the normal gem install command. 并运行正常的gem install命令。 gem install mysql2 -v '0.3.12b6' -- --with-opt-dir="..." gem install mysql2 -v'0.3.12b6' - --with-opt-dir =“...”

NOTE: In case of MySQL Connector/C 6.1, due to the version comparison routine, you cannot use mysql2 module with the following exception. 注意:对于MySQL Connector / C 6.1,由于版本比较例程,您不能使用mysql2模块,但有以下异常。 RuntimeError: Incorrect MySQL client library version! RuntimeError:MySQL客户端库版本不正确! This gem was compiled for 5.7.2-m12 but the client library is 6.1.0. 这个gem编译为5.7.2-m12,但客户端库是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 您应该在http://dev.mysql.com/downloads/connector/c/6.0.html#downloads中使用mysql-connector-c-6.0.2-winx64.msi

Source: https://bugs.ruby-lang.org/issues/8591 资料来源: https//bugs.ruby-lang.org/issues/8591

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM