Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

version 3.0.5 fails with Ruby 2.0p0 #55

Closed
mariochavez opened this Issue · 8 comments

5 participants

@mariochavez

This same works with Ruby 1.9.3p392

irb(main):004:0> hominid.lists                                                     
    RuntimeError: Wrong size. Was 6877, should be 662
from /Users/marioch/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/xmlrpc/client.rb:506:in `do_rpc'
from /Users/marioch/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/xmlrpc/client.rb:281:in `call2'
from /Users/marioch/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/xmlrpc/client.rb:262:in `call'
from /Users/marioch/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/hominid-3.0.5/lib/hominid/api.rb:32:in `method_missing'
from (irb):4
from /Users/marioch/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/railties-3.2.12/lib/rails/commands/console.rb:47:in `start'
from /Users/marioch/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/railties-3.2.12/lib/rails/commands/console.rb:8:in `start'
from /Users/marioch/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/railties-3.2.12/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
@toashd

I have a somehow similar problem when subscribing to a list. While the subscription is successfully done, the problem seems not to be directly related with hominid but rather the xmlrpc client implementation not processing the mailchimp response properly.

The content length in the mailchimp response header is not equal to the response body data length and bytesize, respectively. Maybe this is due to the default encoding changes in Rails 2.0.0.

@mariochavez
@tsagadar

I did file this issue in the Ruby issue tracker at:
http://bugs.ruby-lang.org/issues/8182

As a workaround one could explicitly set the encoding header to 'identity' right after creating the XMLRPC client:
server = XMLRPC::Client.new('service.host.com', '/', 80)
server.http_header_extra = {'accept-encoding' => 'identity'}

@bgetting
Owner

A great option here is to transition to the official Mailchimp gem, which uses version 2.0 (the latest as of right now) of the API. It also does not use XMLRPC.

https://bitbucket.org/mailchimp/mailchimp-api-ruby/

@bgetting bgetting closed this
@henn1nk henn1nk referenced this issue in jcnnghm/devise_mailchimp
Open

Wrong size #15

@badosu

Could this issue be reopened?

The fix looks very simple: just cherry-pick descl@582bb02.

I had this very same issue on my project and migrating to @descl repo fixed that.

@bgetting
Owner

The hominid gem is no longer a viable option for connecting to Mailchimp. The version of the API that it connects to is deprecated. It does not support concurrency. We recommend using the mailchimp-api gem, which is now the official Ruby gem for connecting to the Mailchimp API.

@badosu

Thanks for the response!

Maybe putting this deprecation warning on the header of the README?

I got a project and was not familiar with mailchimp before, so I didn't know it was so outdated, it would be cool if people in the same situation could be warned about this.

Thanks!

@badosu

Actually, just took a better look and saw the warning... Maybe changing it to a heading and also noticing that it won't be maintained anymore?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.