chriswarren / desk

A Ruby wrapper for the Desk.com V2 REST API
MIT License
66 stars 80 forks source link

RuntimeError: missing dependency for FaradayMiddleware::Deashify: undefined method `type' for class `Hashie::Mash' #60

Closed ryanfelton closed 8 years ago

ryanfelton commented 9 years ago

When looking up a customer with email addresses or phone numbers that have a "type" associated with them, the gem fails to parse the response.

Desk.create_customer(
    :first_name => "Joe",
    :last_name => "User",
    :emails => [{:type => "work", :value => "joe.user@example.org"}]
)

Yields this error:

RuntimeError: missing dependency for FaradayMiddleware::Deashify: undefined methodtype' for class Hashie::Mash'

ryanfelton commented 9 years ago

This is also true for the request

> Desk.customer("123456789")
RuntimeError: missing dependency for FaradayMiddleware::Deashify: undefined method `type' for class `Hashie::Mash'
ryanfelton commented 9 years ago

I think it's related to an change in Hashie: https://github.com/intridea/hashie/commit/61fc9a9cbce3999df515f4f291135b51372789c4

robins35 commented 9 years ago

Having the same problem here.

robins35 commented 9 years ago

Fixed by locking hashie at 3.4.0

thomasbalsloev commented 9 years ago

Yup, same problem here. Fixed by locking Hashie gem at 3.4.1. Methods "type" and "id" are removed in Hashie version >= 3.4.2. See https://github.com/intridea/hashie/blob/master/CHANGELOG.md

patakijv commented 8 years ago

Can the fix from Afonso be merged and submitted to rubygems source?

jwfearn commented 8 years ago

+1 please merge Afonso's fix and update rubygems

chriswarren commented 8 years ago

Done. Very sorry for the delay on this.

saverio-kantox commented 7 years ago

Maybe it was just the Mash.send :undef_method, :type in https://github.com/chriswarren/desk/blob/master/lib/desk/deash.rb#L21 ?