On 15/06/07, fREW Schmidt <frioux / gmail.com> wrote:
> Hi all,
>
> I am trying to use the facet units and I am having no luck.  If I do
>
> require 'facets'
>
> and I still can't use any for the unit examples on the facets site.  So
> I tried to do
>
> require 'facet/units'
>
> and I get the following error
>
[snip]
>
> Any ideas on what I am doing wrong?

Thanks for the bug report. This is the easiest way to reproduce your error:

  >> def b(a)
  >> end
  => nil
  >> require 'facets/more/units'
  ArgumentError: wrong number of arguments (0 for 1)
          from /home/peterv/local/lib/ruby/gems/1.8/gems/facets-1.8.54/lib/facets/more/units.rb:710:in
`b'
          from /home/peterv/local/lib/ruby/gems/1.8/gems/facets-1.8.54/lib/facets/more/units.rb:710:in
`clean_eval'
          from /home/peterv/local/lib/ruby/gems/1.8/gems/facets-1.8.54/lib/facets/more/units.rb:710:in
`clean_eval'

Basically, you have a definition of b in Kernel or Object that
interferes with Facets Units. A quick fix would be to undef b:

  >> def b(a)
  >> end
  => nil
  >> undef b
  => nil
  >> require 'facets/more/units'
  => true

Or you could try to figure out how b got defined, which is probably a
library if you didn't define it yourself, and just not load that
library if you want to use Units for the moment.

Peter