我一直在使用1.8.7开发开发中的Rails应用程序,现在正尝试切换到1.9.2(使用RVM)。
但是,在切换红宝石,安装rails并捆绑我的应用程序之后,运行“ rails s”会引发此错误(irb中要求“ mysql2”会给出相同的错误):
/用户/kmurph79/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle:
[BUG]分割错误红宝石
1.9.2p180(2011-02-18修订版30909)[x86_64-darwin10.6.0]
全输出:
-控制框----------
c:0030 p:-541397022 s:0092 b:0092 l:000091 d:000091返回顶部
c:0029 p:---- s:0090 b:0090 l:000089 d:000089 CFUNC:require
c:0028 p:0012 s:0086 b:0086 l:000070 d:000085块/Users/kmurph79/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/dependencies .rb:239
c:0027 p:0005 s:0084 b:0084 l:000075 d:000083块/Users/kmurph79/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/dependencies .rb:225
c:0026 p:0045 s:0082 b:0082 l:000081 d:000081方法/Users/kmurph79/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/dependencies .rb:596
c:0025 p:0041 s:0076 b:0076 l:000075 d:000075方法/Users/kmurph79/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/dependencies .rb:225
c:0024 p:0013 s:0071 b:0071 l:000070 d:000070方法/Users/kmurph79/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/dependencies .rb:239
c:0023 p:0072 s:0066 b:0066 l:000065 d:000065 TOP /Users/kmurph79/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.6/lib/mysql2.rb :7
c:0022 p:---- s:0064 b:0064 l:000063 d:000063完成
c:0021 p:---- s:0062 b:0062 l:000061 d:000061 CFUNC:require
c:0020 p:0026 s:0058 b:0058 l:000039 d:000057块/Users/kmurph79/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/runtime .rb:68
c:0019 p:---- s:0055 b:0055 l:000054 d:000054完成
c:0018 p:---- s:0053 b:0053 l:000052 d:000052 CFUNC:每个
c:0017 p:0091 s:0050 b:0050 l:000039 d:000049块/Users/kmurph79/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/runtime .rb:66
c:0016 p:---- s:0045 b:0045 l:000044 d:000044完成
c:0015 p:---- s:0043 b:0043 l:000042 d:000042 CFUNC:每个
c:0014 p:0046 s:0040 b:0040 l:000039 d:000039方法/Users/kmurph79/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/runtime .rb:55
c:0013 p:0021 s:0036 b:0036 l:000035 d:000035方法/Users/kmurph79/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler.rb :120
c:0012 p:0079 s:0032 b:0032 l:000031 d:000031 TOP /Users/kmurph79/Documents/Rails_Projects/SmugFolio2/config/application.rb:7
c:0011 p:---- s:0030 b:0030 l:000029 d:000029完成
c:0010 p:---- s:0028 b:0028 l:000027 d:000027 CFUNC:require
c:0009 p:0016 s:0024 b:0024 l:000015 d:000023块/Users/kmurph79/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/commands .rb:28
c:0008 p:---- s:0021 b:0021 l:000020 d:000020完成
c:0007 p:---- s:0019 b:0019 l:000018 d:000018 CFUNC:tap
c:0006 p:0468 s:0016 b:0016 l:000015 d:000015 TOP /Users/kmurph79/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/commands .rb:27
c:0005 p:---- s:0012 b:0012 l:000011 d:000011完成
c:0004 p:---- s:0010 b:0010 l:000009 d:000009 CFUNC:require
c:0003 p:0061 s:0006 b:0006 l:0014e8 d:0024c8 EVAL脚本/轨道:6
c:0002 p:---- s:0004 b:0004 l:000003 d:000003完成
c:0001 p:0000 s:0002 b:0002 l:0014e8 d:0014e8 TOP
---------------------------
-Ruby级别的回溯信息----------------------------------------
脚本/ rails:6:in
脚本/ rails:6:在`require'中
/Users/kmurph79/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/commands.rb:27:in`'
/Users/kmurph79/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/commands.rb:27:在“点击”中
/Users/kmurph79/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/commands.rb:28:in`block in'
/Users/kmurph79/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/commands.rb:28:在“要求”中
/Users/kmurph79/Documents/Rails_Projects/SmugFolio2/config/application.rb:7:in`'
/users/kmurph79/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler.rb:120:在'require'中
/用户/kmurph79/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/runtime.rb:55:在'require'中
/users/kmurph79/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/runtime.rb:55:在`each'中
/users/kmurph79/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/runtime.rb:66:in'在需求中阻止'
/Users/kmurph79/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/runtime.rb:66:在`each'中
/Users/kmurph79/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/runtime.rb:68:在'block(2 level)in require'中
/用户/kmurph79/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/runtime.rb:68:在'require'中
/用户/kmurph79/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.6/lib/mysql2.rb:7:在''
/Users/kmurph79/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:在'require'中
/Users/kmurph79/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:在“ load_dependency”中
/Users/kmurph79/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:596:in`new_constants_in'
/Users/kmurph79/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:在“ load_dependency中的块”中
/Users/kmurph79/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in'block in require'
/Users/kmurph79/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:在'require'中
-C级回溯信息-------------------------------------------
[注意]
您可能在Ruby解释器或扩展库中遇到错误。
欢迎报告错误。
有关详细信息:http://www.ruby-lang.org/bugreport.html
中止陷阱
Mysql是通过自制程序安装的,在1.8.7下可以正常工作,但是也许我需要安装新的mysql版本?我不知道。
非常感谢您的帮助。
最佳答案
我通过下载最新版本的MySQL解决了该问题。
关于mysql - 需要mysql2 gem时出现段错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/5348643/