1

语境

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>'
4

2 回答 2

2

建议:

尝试只使用“gem install debugger”而不是“sudo gem install debugger”,因为你使用的是 rvm

于 2012-10-29T18:10:10.737 回答
0

您没有使用捆绑程序。

创建一个 Gemfile 并放置

  gem 'debugger' 

在里面。

创建宝石集

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

并重新测试

于 2015-02-17T20:40:05.370 回答