Forum: Ruby problems with rubygems while debugging

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
42d30e350eba52804bbcca0947eb317d?d=identicon&s=25 Noë Spinner (nspinne)
on 2009-01-28 20:57
When I try to debug a ruby file I got the following message:

$ ruby -rdebug test.rb
Debug.rb
Emacs support available.

/usr/local/lib/ruby/site_ruby/1.8/ubygems.rb:10:require 'rubygems'
(rdb:1)

whenever I try to debug than my test.rb I run into problems with that
rubygems.rb as you can see above:

(rdb:1) b test:3
Set breakpoint 1 at test:3
(rdb:1) c
/usr/local/lib/ruby/1.8/rational.rb:78: `undefined method `gcd' for
Rational(1,
2):Rational' (NoMethodError)
        from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:882:in
`require'
        from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:882
        from /usr/local/lib/ruby/site_ruby/1.8/ubygems.rb:10:in
`require'
        from /usr/local/lib/ruby/site_ruby/1.8/ubygems.rb:10
/usr/local/lib/ruby/1.8/rational.rb:78:    gcd = num.gcd(den)
(rdb:1)

Can anyone help me?
E1e2dd8c03c8e9e0680cfd802df0a04b?d=identicon&s=25 Alex 2k8 (alex_2k8)
on 2009-01-28 23:38
Hello, Noe

You can try this:
  ruby -rubygems -rdebug test.rb

- Alex
42d30e350eba52804bbcca0947eb317d?d=identicon&s=25 Noë Spinner (nspinne)
on 2009-02-01 16:30
Alex 2k8 wrote:
> Hello, Noe
>
> You can try this:
>   ruby -rubygems -rdebug test.rb
>
> - Alex

Hi Alex,

thank you very much, that's it.

 Noë
This topic is locked and can not be replied to.