我剛升級到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