# Strange Error with parseexcel and classifier

**URL:** <https://www.ruby-forum.com/t/strange-error-with-parseexcel-and-classifier/77275>\
**Category:** Ruby\
**Created:** [November 25, 2006, 9:05pm UTC](https://www.ruby-forum.com/t/strange-error-with-parseexcel-and-classifier/77275 "2006-11-25T21:05:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [November 25, 2006, 9:05pm UTC](https://www.ruby-forum.com/t/strange-error-with-parseexcel-and-classifier/77275/1 "2006-11-25T21:05:41Z")

</div>

So I get this strange error when I have the follow two gems in the same  
program:

require ‘parseexcel’  
require ‘classifier’ #bayesian library

Here’s the error:  
c:/Ruby/lib/ruby/gems/1.8/gems/parseexcel-0.5.1.1/lib/parseexcel/olestorage.rb:274:in  
`get_nth_block_no': undefined method`times’ for 1/2:Rational  
(NoMethodError)  
from  
c:/Ruby/lib/ruby/gems/1.8/gems/parseexcel-0.5.1.1/lib/parseexcel/olestorage.rb:286:in  
`get_nth_pps' from c:/Ruby/lib/ruby/gems/1.8/gems/parseexcel-0.5.1.1/lib/parseexcel/olestorage.rb:281:in`fetch’  
from  
c:/Ruby/lib/ruby/gems/1.8/gems/parseexcel-0.5.1.1/lib/parseexcel/olestorage.rb:281:in  
`get_nth_pps' from c:/Ruby/lib/ruby/gems/1.8/gems/parseexcel-0.5.1.1/lib/parseexcel/olestorage.rb:327:in`search\_pps’  
from  
c:/Ruby/lib/ruby/gems/1.8/gems/parseexcel-0.5.1.1/lib/parseexcel/olestorage.rb:343:in  
`search_pps' from c:/Ruby/lib/ruby/gems/1.8/gems/parseexcel-0.5.1.1/lib/parseexcel/olestorage.rb:341:in`each’  
from  
c:/Ruby/lib/ruby/gems/1.8/gems/parseexcel-0.5.1.1/lib/parseexcel/olestorage.rb:341:in  
`search_pps' from c:/Ruby/lib/ruby/gems/1.8/gems/parseexcel-0.5.1.1/lib/parseexcel/parser.rb:173:in`parse’

When I comment out require ‘classifier’ then it works as expected.  
Anyone have any clue why this would be happening? I looked through the  
classifier code and didn’t find anything strange.

Any help would be appreciated.

Cheers.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [November 25, 2006, 9:55pm UTC](https://www.ruby-forum.com/t/strange-error-with-parseexcel-and-classifier/77275/2 "2006-11-25T21:55:46Z")

</div>

To recreate the error, you can run test\_parser.rb that is part of the  
parseexcel test suite. You need to first install the classifier gem.  
Just add require ‘classifier’ to the test before running it and you  
will get the same errors as shown:

1. Error:  
test\_str\_wk7(TestParser):  
NoMethodError: undefined method `downto’ for 1/2:Rational

C:/Ruby/lib/ruby/gems/1.8/gems/parseexcel-0.5.1.1/lib/parseexcel/parser.rb:862:in  
`str_wk' test_parser.rb:521:in`test\_str\_wk7’

1. Error:  
test\_file\_bar(TestParser2):  
NoMethodError: undefined method `times’ for 1/4:Rational

C:/Ruby/lib/ruby/gems/1.8/gems/parseexcel-0.5.1.1/lib/parseexcel/olestorage.rb:274:in  
`get\_nth\_block\_no’

C:/Ruby/lib/ruby/gems/1.8/gems/parseexcel-0.5.1.1/lib/parseexcel/olestorage.rb:286:in  
`get\_nth\_pps’

C:/Ruby/lib/ruby/gems/1.8/gems/parseexcel-0.5.1.1/lib/parseexcel/olestorage.rb:281:in  
`fetch’

C:/Ruby/lib/ruby/gems/1.8/gems/parseexcel-0.5.1.1/lib/parseexcel/olestorage.rb:281:in  
`get\_nth\_pps’

C:/Ruby/lib/ruby/gems/1.8/gems/parseexcel-0.5.1.1/lib/parseexcel/olestorage.rb:327:in  
`search\_pps’

C:/Ruby/lib/ruby/gems/1.8/gems/parseexcel-0.5.1.1/lib/parseexcel/olestorage.rb:343:in  
`search\_pps’

C:/Ruby/lib/ruby/gems/1.8/gems/parseexcel-0.5.1.1/lib/parseexcel/olestorage.rb:341:in  
`each’

C:/Ruby/lib/ruby/gems/1.8/gems/parseexcel-0.5.1.1/lib/parseexcel/olestorage.rb:341:in  
`search\_pps’

C:/Ruby/lib/ruby/gems/1.8/gems/parseexcel-0.5.1.1/lib/parseexcel/parser.rb:173:in  
`parse' test_parser.rb:588:in`test\_file\_bar’

and so on…

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [November 25, 2006, 10:01pm UTC](https://www.ruby-forum.com/t/strange-error-with-parseexcel-and-classifier/77275/3 "2006-11-25T22:01:46Z")

</div>

I wasn’t able to figure out why it was happening, but I was able to  
avoid the error by changing the require ‘classifier’ to require  
‘classifier/bayes’ just in case someone else is having the same  
problem. Cheers.
