Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect header check error? #7

Open
dangeredwolf opened this issue Jun 27, 2014 · 3 comments
Open

Incorrect header check error? #7

dangeredwolf opened this issue Jun 27, 2014 · 3 comments

Comments

@dangeredwolf
Copy link

Whenever I make a request with this Cleverbot API it always has an error like this:

@cleverbotChats: ERROR: Zlib::DataError: incorrect header check
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http/response.rb:357:in finish' /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http/response.rb:357:infinish'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http/response.rb:262:in ensure in inflater' /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http/response.rb:262:ininflater'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http/response.rb:274:in read_body_0' /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http/response.rb:201:inread_body'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:1391:in block in send_entity' /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:1413:inblock (2 levels) in transport_request'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http/response.rb:162:in reading_body' /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:1412:inblock in transport_request'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:1403:in catch' /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:1403:intransport_request'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:1376:in request' /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:1369:inblock in request'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:852:in start' /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:1367:inrequest'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:1390:in send_entity' /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:1179:inpost'
/Library/Ruby/Gems/2.0.0/gems/cleverbot-api-0.0.4/lib/cleverbot-api.rb:43:in make_request' /Library/Ruby/Gems/2.0.0/gems/cleverbot-api-0.0.4/lib/cleverbot-api.rb:23:inthink'
/Users/ryandolan123/cleverbot/bots.rb:58:in `block (2 levels) in <top (required)>'

Is this because of Cleverbot API changes? Or Ruby 2.0.0 incompatibility?

@neilgupta
Copy link

There seems to be a problem with the net/http library in Ruby 2.0+ related to decompressing gzipped headers. The fastest fix is to just use RestClient instead. In case you're still looking, you can use my fork at https://github.com/neilgupta/cleverbot-api for a working version:

gem 'cleverbot-api', :git => 'git://github.com/neilgupta/cleverbot-api.git'

@cgardens
Copy link

@neilgupta When I try to put your line of code in my gem file and bundle install, it seems like the gem isn't actually being installed.

/Users/Charles/.rbenv/versions/2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- cleverbot-api (LoadError)
    from /Users/Charles/.rbenv/versions/2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from bots.rb:1:in `<main>'

When I do the following it works:

  1. git clone 'git://github.com/neilgupta/cleverbot-api.git'
  2. cd cleverbot-api/
  3. gem build cleverbot-api.gemspec
  4. sudo gem install cleverbot-api

Is there something I'm missing? Ideally I want to be able to just stick your fork of cleverbot in my gemfile and bundle install without having to actually build the gem manually in the command line.

Apologies if I'm missing something obvious. My first time trying to pull gem from a github repo.

@neilgupta
Copy link

If you check your Gemfile.lock, do you see the cleverbot-api gem properly loaded from my github fork? If yes, my first guess would be this is a configuration problem with rbenv not finding the bundler installed gem, but it is able to find it when you install it to the whole system via gem install.

Are you prefixing your start command with bundle exec (ie bundle exec rails s)? If not, try that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants