Alle sabato 5 gennaio 2008, Damaris Fuentes ha scritto:
Hi,
I get this:
"undefined method `format_s' for 10067064106:Bignum"
So my question is, I'm afraid, how can I install the Numeric extension?
(I always thought the extensions come with the Ruby installation...)
Thanks.
If you have already rubygems installed, you can install extensions through it:
gem install -r extensions
(if you're on unix, you'll need to use sudo to do this).
If you don't have rubygems installed, you can install it (look at the
rubyforge page for rubygems for how to do it) or install extensions by hand.
To do this, go to the extensions project page on rubyforge(
http://rubyforge.org/projects/extensions/ ), follow the download link and
download the tgz file. At this point, you need to extract the files in the
tgz file and put them somewhere ruby will look for them (you can get a list
of such places looking at the $: global variable from irb). Depending on the
operating system you use, these paths may vary. For instance, on my gentoo
system, they are:
/usr/lib/ruby/site_ruby/1.8
/usr/lib/ruby/site_ruby/1.8/i686-linux
/usr/lib/ruby/site_ruby
/usr/lib/ruby/1.8
/usr/lib/ruby/1.8/i686-linux
The most appropriate place in this case should be /usr/lib/ruby/site_ruby/1.8.
Another option is to put the files in any directory and add it to the ruby
load path either via the environment variable RUBYLIB or using the -L switch
when calling ruby or modifying the $: variable from inside your ruby program.
I hope this helps
Stefano