Strange Error with parseexcel and classifier...

Discussion in 'Ruby' started by appleman@gmail.com, Nov 25, 2006.

  1. Guest

    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.
    , Nov 25, 2006
    #1
    1. Advertising

  2. Guest

    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'

    2) 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...
    On Nov 25, 3:01 pm, "" <> wrote:
    > 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.
    , Nov 25, 2006
    #2
    1. Advertising

  3. Guest

    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.
    wrote:
    > 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'
    >
    > 2) 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...
    > On Nov 25, 3:01 pm, "" <> wrote:
    > > 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.
    , Nov 25, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. penny336
    Replies:
    1
    Views:
    654
    tom_usenet
    Nov 7, 2003
  2. Robin Becker

    pop3 email header classifier?

    Robin Becker, Sep 19, 2003, in forum: Python
    Replies:
    6
    Views:
    403
    David Mertz
    Sep 23, 2003
  3. Lucas Carlson
    Replies:
    4
    Views:
    133
    Dave Fayram
    Apr 25, 2005
  4. Tom Reilly

    classifier lsi and ruby gsl

    Tom Reilly, May 4, 2005, in forum: Ruby
    Replies:
    2
    Views:
    109
    Dave Fayram
    May 5, 2005
  5. Luiz
    Replies:
    2
    Views:
    83
    Chris Shea
    Dec 27, 2006
Loading...

Share This Page