hulihanapplications / fletcher

A cross-website product information fetcher for ruby.
http://www.hulihanapplications.com
MIT License
53 stars 12 forks source link

undefined method `parse' for Money:Class #13

Closed edwardloveall closed 10 years ago

edwardloveall commented 10 years ago

I get an error when running Fletcher.fetch in the rails console:

Fletcher.fetch "http://www.amazon.com/OXO-Grips-Wooden-Spoon-3-Piece/dp/B008H2JLP8/"
NoMethodError: undefined method `parse' for Money:Class
    from /Users/edwardloveall/.gem/ruby/2.0.0/gems/fletcher-0.6.6/lib/fletcher/models/base.rb:21:in `parse_price'
    from /Users/edwardloveall/.gem/ruby/2.0.0/gems/fletcher-0.6.6/lib/fletcher/models/amazon.rb:27:in `parse'
    from /Users/edwardloveall/.gem/ruby/2.0.0/gems/fletcher-0.6.6/lib/fletcher.rb:30:in `fetch'
    from (irb):1
    from /Users/edwardloveall/.gem/ruby/2.0.0/gems/railties-4.0.0/lib/rails/commands/console.rb:90:in `start'
    from /Users/edwardloveall/.gem/ruby/2.0.0/gems/railties-4.0.0/lib/rails/commands/console.rb:9:in `start'
    from /Users/edwardloveall/.gem/ruby/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:64:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'

My goal was to get rid of deprecation warnings when calling fetch by updating the money and monetize gems, but I'm stuck here at the moment.

dhulihan commented 10 years ago

Hi Edward - Do you have a fork I can test? I didn't see one on your profile.

dhulihan commented 10 years ago

Nevermind, I just updated the code to use Monetize.parse instead of Money.parse, since that's a hopefully simple update :) . https://github.com/hulihanapplications/fletcher/commit/a55a3091aeb64848ff65e6d0d14e280a79fb4210