我刚升级到ruby 1.9.3-p0和rails 3.2.0。现在我想用Rails 3.2.0 rspec调试器不能正常工作
rspec spec -d
调试在我的测试一个错误,但我得到这个错误:
/home/map7/.rvm/gems/[email protected]/gems/rspec-core-2.8.0/lib/rspec/core/configuration.rb:422:in `rescue in debug=': (RuntimeError)
**************************************************
/home/map7/.rvm/gems/[email protected]/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.so: undefined symbol: ruby_threadptr_data_type - /home/map7/.rvm/gems/[email protected]/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.so
If you have it installed as a ruby gem, then you need to either require
'rubygems' or configure the RUBYOPT environment variable with the value
'rubygems'.
/home/map7/.rvm/gems/[email protected]/gems/ruby-debug-base19-0.11.25/lib/ruby-debug-base.rb:1:in `require'
/home/map7/.rvm/gems/[email protected]/gems/ruby-debug-base19-0.11.25/lib/ruby-debug-base.rb:1:in `<top (required)>'
/home/map7/.rvm/gems/[email protected]/gems/ruby-debug19-0.11.6/cli/ruby-debug.rb:5:in `require'
/home/map7/.rvm/gems/[email protected]/gems/ruby-debug19-0.11.6/cli/ruby-debug.rb:5:in `<top (required)>'
/home/map7/.rvm/gems/[email protected]/gems/rspec-core-2.8.0/lib/rspec/core/configuration.rb:408:in `require'
/home/map7/.rvm/gems/[email protected]/gems/rspec-core-2.8.0/lib/rspec/core/configuration.rb:408:in `debug='
/home/map7/.rvm/gems/[email protected]/gems/rspec-core-2.8.0/lib/rspec/core/configuration_options.rb:19:in `block in configure'
/home/map7/.rvm/gems/[email protected]/gems/rspec-core-2.8.0/lib/rspec/core/configuration_options.rb:18:in `each'
/home/map7/.rvm/gems/[email protected]/gems/rspec-core-2.8.0/lib/rspec/core/configuration_options.rb:18:in `configure'
/home/map7/.rvm/gems/[email protected]/gems/rspec-core-2.8.0/lib/rspec/core/command_line.rb:21:in `run'
/home/map7/.rvm/gems/[email protected]/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:80:in `run_in_process'
/home/map7/.rvm/gems/[email protected]/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:69:in `run'
/home/map7/.rvm/gems/[email protected]/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:10:in `block in autorun'
**************************************************
from /home/map7/.rvm/gems/[email protected]/gems/rspec-core-2.8.0/lib/rspec/core/configuration.rb:407:in `debug='
from /home/map7/.rvm/gems/[email protected]/gems/rspec-core-2.8.0/lib/rspec/core/configuration_options.rb:19:in `block in configure'
from /home/map7/.rvm/gems/[email protected]/gems/rspec-core-2.8.0/lib/rspec/core/configuration_options.rb:18:in `each'
from /home/map7/.rvm/gems/[email protected]/gems/rspec-core-2.8.0/lib/rspec/core/configuration_options.rb:18:in `configure'
from /home/map7/.rvm/gems/[email protected]/gems/rspec-core-2.8.0/lib/rspec/core/command_line.rb:21:in `run'
from /home/map7/.rvm/gems/[email protected]/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:80:in `run_in_process'
from /home/map7/.rvm/gems/[email protected]/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:69:in `run'
from /home/map7/.rvm/gems/[email protected]/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:10:in `block in autorun'
外貌
像[debugger gem](https://github.com/cldwalker/debugger)专门用于处理Ruby 1.9.2和1.9.3。这是一个ruby-debug19的分支([Fork for Reason](http://rubydoc.info/gems/debugger/1.2.0/file/README.md#Reason_for_Fork))。请参阅[本SO回答]中的简易安装说明(http://stackoverflow.com/a/12294770/550712)。 – 2012-09-14 20:22:12
这应该是公认的答案。 – 2012-11-07 01:18:10
对于那些使用Debugger并仍然出错的人,请参阅[Github issue thread](https://github.com/cldwalker/debugger/issues/12)。有些人不得不手动安装调试器依赖项。那个线程并不是我所需要的,但是其中的一些东西让我找到了我需要的解决方案,即在迁移到新系统后重新安装rvm,ruby和gcc依赖项。 – 2012-11-07 23:32:46