要求'debugger'=> LoadError。为什么?

时间:2012-10-29 09:49:26

标签: ruby-on-rails ruby

上下文

ruby 1.9.2p323 (2012-05-22 revision 35755) [x86_64-darwin11.4.0]

rvm 1.16.6

gemsets for ruby-1.9.2-head 
   (default)
   global
=> rails321

微量

$ gem install 'debugger'
Building native extensions.  This could take a while...
Successfully installed debugger-1.2.1

$ bundle show debugger
/Users/PH/.rvm/gems/ruby-1.9.2-head@rails321/gems/debugger-1.2.1

$ irb
> require 'debugger'
LoadError: no such file to load -- trace_nums
    from /Users/PH/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/PH/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/PH/.rvm/gems/ruby-1.9.2-head@rails321/gems/debugger-linecache-1.1.2/lib/tracelines19.rb:3:in `<top (required)>'
    from /Users/PH/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/PH/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/PH/.rvm/gems/ruby-1.9.2-head@rails321/gems/debugger-linecache-1.1.2/lib/linecache19.rb:65:in `<top (required)>'
    from /Users/PH/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/PH/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/PH/.rvm/gems/ruby-1.9.2-head@rails321/gems/debugger-1.2.1/lib/ruby-debug-base.rb:2:in `<top (required)>'
    from /Users/PH/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/PH/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/PH/.rvm/gems/ruby-1.9.2-head@rails321/gems/debugger-1.2.1/lib/ruby-debug.rb:5:in `<top (required)>'
    from /Users/PH/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/PH/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/PH/.rvm/gems/ruby-1.9.2-head@rails321/gems/debugger-1.2.1/lib/debugger.rb:4:in `<top (required)>'
    from /Users/PH/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
    from /Users/PH/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
    from /Users/PH/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
    from (irb):1
    from /Users/PH/.rvm/rubies/ruby-1.9.2-head/bin/irb:16:in `<main>'

2 个答案:

答案 0 :(得分:2)

建议:

尝试使用“gem install debugger”代替“sudo gem install debugger”,因为你使用rvm

答案 1 :(得分:0)

您没有使用捆绑包。

创建一个Gemfile并放入

  gem 'debugger' 

在其中。

创建一个gemset

 rvm use 1.9.2
 rvm gemset create [my-app-name]
 rvm use [my-app-name] # 
 bundle

重新测试