# Facets

**URL:** <https://www.ruby-forum.com/t/facets/66926>\
**Category:** Ruby\
**Created:** [August 30, 2006, 12:08pm UTC](https://www.ruby-forum.com/t/facets/66926 "2006-08-30T12:08:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stephen\_Ng](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e47774/32.png) [@Stephen\_Ng](https://www.ruby-forum.com/u/Stephen_Ng)\
**Post date:** [August 30, 2006, 12:08pm UTC](https://www.ruby-forum.com/t/facets/66926/1 "2006-08-30T12:08:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Stephen\_Ng](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e47774/32.png) [@Stephen\_Ng](https://www.ruby-forum.com/u/Stephen_Ng)\
**Post date:** [August 30, 2006, 1:30pm UTC](https://www.ruby-forum.com/t/facets/66926/2 "2006-08-30T13:30:56Z")

</div>

Stephen Ng wrote:

> ```
> 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.

---

<div class="post-metadata">

**Author:** ![Stephen\_Ng](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e47774/32.png) [@Stephen\_Ng](https://www.ruby-forum.com/u/Stephen_Ng)\
**Post date:** [August 30, 2006, 5:43pm UTC](https://www.ruby-forum.com/t/facets/66926/3 "2006-08-30T17:43:28Z")

</div>

On Aug 30, 2006, at 6:30 AM, Trans wrote:

> 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 G. II

---

<div class="post-metadata">

**Author:** ![Stephen\_Ng](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e47774/32.png) [@Stephen\_Ng](https://www.ruby-forum.com/u/Stephen_Ng)\
**Post date:** [August 31, 2006, 9:00pm UTC](https://www.ruby-forum.com/t/facets/66926/4 "2006-08-31T21:00:54Z")

</div>

James Edward G. II wrote:

> [1, 2, 3]  
> [4, 5, 6]  
> [7, 8, 9]  
> [10]
> 
> James Edward G. II

Righ on. Thanks.

T.
