From: Daniel Berger Date: 2006-03-30T04:38:38+09:00 Subject: Re: Where is Fixnum#power! coming from? Daniel Harple wrote: > On Mar 29, 2006, at 9:22 PM, Daniel Berger wrote: > >> I realize there's a Fixnum#power! method defined in rational.rb, but >> it appears that Fixnum has that method available to it whether or not >> I require rational.rb. I looked through the Ruby source and didn't >> see anything. >> >> djberge@~-710>irb >> irb(main):001:0> Fixnum.instance_methods(false).grep(/power/) >> => ["rpower", "power!"] >> >> So, where the heck is it coming from? > > $ irb -rubygems > > 2.power!(3) > => 8 > > exit > $ irb > > 2.power!(3) > NoMethodError: undefined method `power!' for 2:Fixnum > from (irb):1 > from :0 > > Are you requiring rubygems? > > -- Daniel Aha! I'm not explicitly require'ing it, but my $RUBYOPT was set. Once I unset it, I got the expected error. Thanks, Dan