facets

S

Stephen Ng

Hi!

I just tried installing facets-1.7.30.

I keep getting this error -

require 'facets'
LoadError: no such file to load -- facets/core/enumerable/each_slice
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'
from /usr/lib/ruby/gems/1.8/gems/facets-1.7.30/lib/facets.rb:89
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:33:in
`require'
from (irb):2

I get the same error when installing the facets gem.

Can anyone help?

Regards.

Stephen
 
T

Trans

Stephen said:
Hi!

I just tried installing facets-1.7.30.

I keep getting this error -

require 'facets'
LoadError: no such file to load -- facets/core/enumerable/each_slice
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'
from /usr/lib/ruby/gems/1.8/gems/facets-1.7.30/lib/facets.rb:89
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:33:in
`require'
from (irb):2

I get the same error when installing the facets gem.

My apologies for any inconvenience. enumerable/each_slice is being
deprecated. Unfortunately the ChangeLog entry for this got mangled
somehow and said nothing but "ice" (the last three letters of of
each_slice). The reason is Ruby now supports each_slice in the standard
library. All you have to do is:

require 'enumerator'

And I beleive as of Ruby 1.9 this will built-in functionality too and
there will no longer be a need for the require (Can anyone verify
that?)

Nonetheless I'll am goging to release a minor update to facets today
that fixes this issue. It will be a temproray patch the will just
redirect 'enumerable/each_slice' to 'enumerator'.

One important consideration though is that Ruby's each_slice and
Facets' previous version differ in that Ruby's will not use the block's
arity if no slice count is given --it will raise an Argument error
instead. To get this behavior back use Facets' #each_by (maybe I'll
submit an RCR for this).

HTH,
T.
 
J

James Edward Gray II

And I beleive as of Ruby 1.9 this will built-in functionality too and
there will no longer be a need for the require (Can anyone verify
that?)

$ ruby_yarv -ve '(1..10).each_slice(3) { |trio| p trio }'
ruby 2.0.0 (Base: Ruby 1.9.0 2006-04-08) [i686-darwin8.7.1]
YARVCore 0.4.1 Rev: 527 (2006-07-19) [opts: [direct threaded code]
[inline method cache] ]
[1, 2, 3]
[4, 5, 6]
[7, 8, 9]
[10]

James Edward Gray II
 
T

Trans

James said:
And I beleive as of Ruby 1.9 this will built-in functionality too and
there will no longer be a need for the require (Can anyone verify
that?)

$ ruby_yarv -ve '(1..10).each_slice(3) { |trio| p trio }'
ruby 2.0.0 (Base: Ruby 1.9.0 2006-04-08) [i686-darwin8.7.1]
YARVCore 0.4.1 Rev: 527 (2006-07-19) [opts: [direct threaded code]
[inline method cache] ]
[1, 2, 3]
[4, 5, 6]
[7, 8, 9]
[10]

James Edward Gray II

Righ on. Thanks.

T.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,202
Messages
2,571,057
Members
47,664
Latest member
RoseannBow

Latest Threads

Top