Windows Server 2008 上的 Database Gems For Ruby 1.9.2 出现分段错误

发布于 2024-10-07 00:21:42 字数 5340 浏览 4 评论 0原文

我正在尝试在 Windows Server 2008 上启动并运行 Rails 应用程序,但遇到了障碍...我已经安装了 mysql2 gem,每当我尝试在 irb 中要求它来测试安装时,我都会得到一个令人讨厌的分段错误。

C:\Users\Administrator>gem install mysql2
Successfully installed mysql2-0.2.6-x86-mingw32
1 gem installed
Installing ri documentation for mysql2-0.2.6-x86-mingw32...
Enclosing class/module 'mMysql2' for class Client not known
Installing RDoc documentation for mysql2-0.2.6-x86-mingw32...
Enclosing class/module 'mMysql2' for class Client not known

C:\Users\Administrator>irb
irb(main):001:0> require 'mysql2'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/mysql2/1.9/mysql2.so: [BUG] Segmentation fault
ruby 1.9.2p0 (2010-08-18) [i386-mingw32]

-- control frame ----------
c:0035 p:-11375406 s:0122 b:0122 l:000121 d:000121 TOP
c:0034 p:---- s:0120 b:0120 l:000119 d:000119 CFUNC  :require
c:0033 p:0013 s:0116 b:0116 l:000115 d:000115 METHOD :29
c:0032 p:0032 s:0111 b:0111 l:000110 d:000110 TOP    C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/mysql2/mysql2.rb:2
c:0031 p:---- s:0109 b:0109 l:000108 d:000108 FINISH
c:0030 p:---- s:0107 b:0107 l:000106 d:000106 CFUNC  :require
c:0029 p:0013 s:0103 b:0103 l:000102 d:000102 METHOD :29
c:0028 p:0072 s:0098 b:0098 l:000097 d:000097 TOP    C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/mysql2.rb:7
c:0027 p:---- s:0096 b:0096 l:000095 d:000095 FINISH
c:0026 p:---- s:0094 b:0094 l:000093 d:000093 CFUNC  :require
c:0025 p:0073 s:0090 b:0090 l:000086 d:000089 BLOCK  :33
c:0024 p:0014 s:0087 b:0087 l:000086 d:000086 METHOD :29
c:0023 p:0011 s:0082 b:0082 l:001f94 d:000081 EVAL   (irb):1
c:0022 p:---- s:0080 b:0080 l:000079 d:000079 FINISH
c:0021 p:---- s:0078 b:0078 l:000077 d:000077 CFUNC  :eval
c:0020 p:0028 s:0071 b:0071 l:000070 d:000070 METHOD C:/Ruby192/lib/ruby/1.9.1/irb/workspace.rb:80
c:0019 p:0033 s:0064 b:0063 l:000062 d:000062 METHOD C:/Ruby192/lib/ruby/1.9.1/irb/context.rb:254
c:0018 p:0031 s:0058 b:0058 l:0003e4 d:000057 BLOCK  C:/Ruby192/lib/ruby/1.9.1/irb.rb:159
c:0017 p:0042 s:0050 b:0050 l:000049 d:000049 METHOD C:/Ruby192/lib/ruby/1.9.1/irb.rb:273
c:0016 p:0011 s:0045 b:0045 l:0003e4 d:000044 BLOCK  C:/Ruby192/lib/ruby/1.9.1/irb.rb:156
c:0015 p:0144 s:0041 b:0041 l:000024 d:000040 BLOCK  C:/Ruby192/lib/ruby/1.9.1/irb/ruby-lex.rb:243
c:0014 p:---- s:0038 b:0038 l:000037 d:000037 FINISH
c:0013 p:---- s:0036 b:0036 l:000035 d:000035 CFUNC  :loop
c:0012 p:0009 s:0033 b:0033 l:000024 d:000032 BLOCK  C:/Ruby192/lib/ruby/1.9.1/irb/ruby-lex.rb:229
c:0011 p:---- s:0031 b:0031 l:000030 d:000030 FINISH
c:0010 p:---- s:0029 b:0029 l:000028 d:000028 CFUNC  :catch
c:0009 p:0023 s:0025 b:0025 l:000024 d:000024 METHOD C:/Ruby192/lib/ruby/1.9.1/irb/ruby-lex.rb:228
c:0008 p:0046 s:0022 b:0022 l:0003e4 d:0003e4 METHOD C:/Ruby192/lib/ruby/1.9.1/irb.rb:155
c:0007 p:0011 s:0019 b:0019 l:000ca4 d:000018 BLOCK  C:/Ruby192/lib/ruby/1.9.1/irb.rb:70
c:0006 p:---- s:0017 b:0017 l:000016 d:000016 FINISH
c:0005 p:---- s:0015 b:0015 l:000014 d:000014 CFUNC  :catch
c:0004 p:0183 s:0011 b:0011 l:000ca4 d:000ca4 METHOD C:/Ruby192/lib/ruby/1.9.1/irb.rb:69
c:0003 p:0039 s:0006 b:0006 l:0017b4 d:000334 EVAL   C:/Ruby192/bin/irb:12
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:0017b4 d:0017b4 TOP
---------------------------
-- Ruby level backtrace information ----------------------------------------
C:/Ruby192/bin/irb:12:in `'
C:/Ruby192/lib/ruby/1.9.1/irb.rb:69:in `start'
C:/Ruby192/lib/ruby/1.9.1/irb.rb:69:in `catch'
C:/Ruby192/lib/ruby/1.9.1/irb.rb:70:in `block in start'
C:/Ruby192/lib/ruby/1.9.1/irb.rb:155:in `eval_input'
C:/Ruby192/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in `each_top_level_statement'
C:/Ruby192/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in `catch'
C:/Ruby192/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `block in each_top_level_statement'
C:/Ruby192/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `loop'
C:/Ruby192/lib/ruby/1.9.1/irb/ruby-lex.rb:243:in `block (2 levels) in each_top_level_statement'
C:/Ruby192/lib/ruby/1.9.1/irb.rb:156:in `block in eval_input'
C:/Ruby192/lib/ruby/1.9.1/irb.rb:273:in `signal_status'
C:/Ruby192/lib/ruby/1.9.1/irb.rb:159:in `block (2 levels) in eval_input'
C:/Ruby192/lib/ruby/1.9.1/irb/context.rb:254:in `evaluate'
C:/Ruby192/lib/ruby/1.9.1/irb/workspace.rb:80:in `evaluate'
C:/Ruby192/lib/ruby/1.9.1/irb/workspace.rb:80:in `eval'
(irb):1:in `irb_binding'
:29:in `require'
:33:in `rescue in require'
:33:in `require'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/mysql2.rb:7:in`'
:29:in `require'
:29:in `require'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/mysql2/mysql2.rb:2:in `'
:29:in `require'
:29:in `require'

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

此应用程序已请求运行时以异常方式终止它。 请联系应用程序的支持团队以获取更多信息。

我尝试将 libmysql.dll 复制到我的 Ruby bin 文件夹,但这没有帮助。 我什至尝试使用 mysql gem 并得到相同类型的错误,但这次是在 mysql_api.so 文件上。

然后我想我可以尝试一下sqlite3,但我仍然收到错误。

如果有什么区别,这里是我的版本:

C:\Users\Administrator>mysql --version mysql Ver 14.12 Distrib 5.0.83,适用于 Win32 (ia32)

C:\Users\Administrator>rails -v Rails 3.0.3

C:\Users\Administrator>ruby -v ruby 1.9.2p0 (2010-08-18) [i386-mingw32]

我希望有人可以帮助我。提前致谢。

I'm trying to get a rails app up and running on Windows Server 2008, and have hit a road block... I've installed the mysql2 gem and whenever I try to require it in irb to test the install, I get a nasty segmentation fault.

C:\Users\Administrator>gem install mysql2
Successfully installed mysql2-0.2.6-x86-mingw32
1 gem installed
Installing ri documentation for mysql2-0.2.6-x86-mingw32...
Enclosing class/module 'mMysql2' for class Client not known
Installing RDoc documentation for mysql2-0.2.6-x86-mingw32...
Enclosing class/module 'mMysql2' for class Client not known

C:\Users\Administrator>irb
irb(main):001:0> require 'mysql2'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/mysql2/1.9/mysql2.so: [BUG] Segmentation fault
ruby 1.9.2p0 (2010-08-18) [i386-mingw32]

-- control frame ----------
c:0035 p:-11375406 s:0122 b:0122 l:000121 d:000121 TOP
c:0034 p:---- s:0120 b:0120 l:000119 d:000119 CFUNC  :require
c:0033 p:0013 s:0116 b:0116 l:000115 d:000115 METHOD :29
c:0032 p:0032 s:0111 b:0111 l:000110 d:000110 TOP    C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/mysql2/mysql2.rb:2
c:0031 p:---- s:0109 b:0109 l:000108 d:000108 FINISH
c:0030 p:---- s:0107 b:0107 l:000106 d:000106 CFUNC  :require
c:0029 p:0013 s:0103 b:0103 l:000102 d:000102 METHOD :29
c:0028 p:0072 s:0098 b:0098 l:000097 d:000097 TOP    C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/mysql2.rb:7
c:0027 p:---- s:0096 b:0096 l:000095 d:000095 FINISH
c:0026 p:---- s:0094 b:0094 l:000093 d:000093 CFUNC  :require
c:0025 p:0073 s:0090 b:0090 l:000086 d:000089 BLOCK  :33
c:0024 p:0014 s:0087 b:0087 l:000086 d:000086 METHOD :29
c:0023 p:0011 s:0082 b:0082 l:001f94 d:000081 EVAL   (irb):1
c:0022 p:---- s:0080 b:0080 l:000079 d:000079 FINISH
c:0021 p:---- s:0078 b:0078 l:000077 d:000077 CFUNC  :eval
c:0020 p:0028 s:0071 b:0071 l:000070 d:000070 METHOD C:/Ruby192/lib/ruby/1.9.1/irb/workspace.rb:80
c:0019 p:0033 s:0064 b:0063 l:000062 d:000062 METHOD C:/Ruby192/lib/ruby/1.9.1/irb/context.rb:254
c:0018 p:0031 s:0058 b:0058 l:0003e4 d:000057 BLOCK  C:/Ruby192/lib/ruby/1.9.1/irb.rb:159
c:0017 p:0042 s:0050 b:0050 l:000049 d:000049 METHOD C:/Ruby192/lib/ruby/1.9.1/irb.rb:273
c:0016 p:0011 s:0045 b:0045 l:0003e4 d:000044 BLOCK  C:/Ruby192/lib/ruby/1.9.1/irb.rb:156
c:0015 p:0144 s:0041 b:0041 l:000024 d:000040 BLOCK  C:/Ruby192/lib/ruby/1.9.1/irb/ruby-lex.rb:243
c:0014 p:---- s:0038 b:0038 l:000037 d:000037 FINISH
c:0013 p:---- s:0036 b:0036 l:000035 d:000035 CFUNC  :loop
c:0012 p:0009 s:0033 b:0033 l:000024 d:000032 BLOCK  C:/Ruby192/lib/ruby/1.9.1/irb/ruby-lex.rb:229
c:0011 p:---- s:0031 b:0031 l:000030 d:000030 FINISH
c:0010 p:---- s:0029 b:0029 l:000028 d:000028 CFUNC  :catch
c:0009 p:0023 s:0025 b:0025 l:000024 d:000024 METHOD C:/Ruby192/lib/ruby/1.9.1/irb/ruby-lex.rb:228
c:0008 p:0046 s:0022 b:0022 l:0003e4 d:0003e4 METHOD C:/Ruby192/lib/ruby/1.9.1/irb.rb:155
c:0007 p:0011 s:0019 b:0019 l:000ca4 d:000018 BLOCK  C:/Ruby192/lib/ruby/1.9.1/irb.rb:70
c:0006 p:---- s:0017 b:0017 l:000016 d:000016 FINISH
c:0005 p:---- s:0015 b:0015 l:000014 d:000014 CFUNC  :catch
c:0004 p:0183 s:0011 b:0011 l:000ca4 d:000ca4 METHOD C:/Ruby192/lib/ruby/1.9.1/irb.rb:69
c:0003 p:0039 s:0006 b:0006 l:0017b4 d:000334 EVAL   C:/Ruby192/bin/irb:12
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:0017b4 d:0017b4 TOP
---------------------------
-- Ruby level backtrace information ----------------------------------------
C:/Ruby192/bin/irb:12:in `'
C:/Ruby192/lib/ruby/1.9.1/irb.rb:69:in `start'
C:/Ruby192/lib/ruby/1.9.1/irb.rb:69:in `catch'
C:/Ruby192/lib/ruby/1.9.1/irb.rb:70:in `block in start'
C:/Ruby192/lib/ruby/1.9.1/irb.rb:155:in `eval_input'
C:/Ruby192/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in `each_top_level_statement'
C:/Ruby192/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in `catch'
C:/Ruby192/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `block in each_top_level_statement'
C:/Ruby192/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `loop'
C:/Ruby192/lib/ruby/1.9.1/irb/ruby-lex.rb:243:in `block (2 levels) in each_top_level_statement'
C:/Ruby192/lib/ruby/1.9.1/irb.rb:156:in `block in eval_input'
C:/Ruby192/lib/ruby/1.9.1/irb.rb:273:in `signal_status'
C:/Ruby192/lib/ruby/1.9.1/irb.rb:159:in `block (2 levels) in eval_input'
C:/Ruby192/lib/ruby/1.9.1/irb/context.rb:254:in `evaluate'
C:/Ruby192/lib/ruby/1.9.1/irb/workspace.rb:80:in `evaluate'
C:/Ruby192/lib/ruby/1.9.1/irb/workspace.rb:80:in `eval'
(irb):1:in `irb_binding'
:29:in `require'
:33:in `rescue in require'
:33:in `require'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/mysql2.rb:7:in`'
:29:in `require'
:29:in `require'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/mysql2/mysql2.rb:2:in `'
:29:in `require'
:29:in `require'

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

I've tried copying the libmysql.dll over to my Ruby bin folder, and that didn't help.
I've even tried using the mysql gem and get the same kind of error but this time on the mysql_api.so file.

Then I thought I might just try sqlite3 and I still got the error.

If it makes any difference here are my versions:

C:\Users\Administrator>mysql --version
mysql Ver 14.12 Distrib 5.0.83, for Win32 (ia32)

C:\Users\Administrator>rails -v
Rails 3.0.3

C:\Users\Administrator>ruby -v
ruby 1.9.2p0 (2010-08-18) [i386-mingw32]

I hope someone can help me. Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

风蛊 2024-10-14 00:21:42

如果您在 Windows 上使用 ruby​​ 安装程序:

  • 将 mysql 5.1 中的 libmysql 与 ruby​​ 1.9.2 一起使用
  • 将 mysql 5.0 中的 libmysql 与 ruby​​ 1.8.7 一起使用

在这两种情况下,您都可以使用 My SQL Server 5.1。当您使用 ruby​​ 1.8.7 时,它将与旧的客户端库一起使用。

If you are using the ruby installer on windows:

  • Use libmysql from mysql 5.1 with ruby 1.9.2
  • Use libmysql fro mysql 5.0 with ruby 1.8.7

In both cases you can use the My SQL Server 5.1. It will work with the older client library when you are working in ruby 1.8.7.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文