From: Guillaume Marcais Date: 2006-01-18T06:44:20+09:00 Subject: Re: basic question about Fixnum & Integer Is it true that RubyGems requires mathn? It seems so to me: gus@guslaptop ~]ruby -e 'p(5.lcm(3))' -e:1: undefined method `lcm' for 5:Fixnum (NoMethodError) gus@guslaptop ~]ruby -rubygems -e 'p(5.lcm(3))' 15 gus@guslaptop ~]ruby -v ruby 1.8.4 (2005-12-24) [i686-linux] gus@guslaptop ~]gem -v 0.8.11 That gives me somewhat of an uneasy feeling. How many core tampering libraries does RubyGems requires that may make me rely on methods which are not really in the core? Guillaume. Tom Allison wrote: > Jules wrote: >> No, you don't have to require integer, because it is in the core. The >> core is always available. You can read the docs here: >> >> http://www.ruby-doc.org/core/ >> >> And there is a standard library too: >> >> http://www.ruby-doc.org/stdlib/ >> >> Most of these are not available by default. If you want to use a YAML >> parser, you have to require YAML. >> > > Thanks for the references. > > For some reason I can't get my installation of Ruby to do what the > examples show: > > 6.lcm 7 > > return > > >> 6.lcm 7 > NoMethodError: undefined method `lcm' for 6:Fixnum > from (irb):17 > from :0 > >> 6.lcm(7) > NoMethodError: undefined method `lcm' for 6:Fixnum > from (irb):18 > from :0 > > > This is too simple to get wrong? >