Skip to content

fixed JSON parsing #4

Closed
wants to merge 1 commit into from

2 participants

@monfresh

Without the "to_json" method, you get "TypeError: can't convert Hash into String" when
requesting "client.info" for example, in irb. I'm using Ruby 1.9.3p125
and version 1.6.6 of the json gem.

@monfresh monfresh fixed JSON parsing
otherwise, you get "TypeError: can't convert Hash into String" when
requesting "client.info" for example, in irb. I'm using Ruby 1.9.3p125
and version 1.6.6 of the json gem.
aa315ea
@codingjester
Owner

Weird I can't seem to replicate. I did a fresh install of 1.9.3-p125 and it worked. Below is a list of the versions of gems that I have installed. My current assumption is that Faraday isn't parsing it as JSON like it should...

addressable (2.2.7)
bundler (1.1.3)
faraday (0.7.6)
faraday-stack (0.1.5)
json (1.6.6)
multipart-post (1.1.5)
rack (1.4.1)
rake (0.9.2.2, 0.9.2)
rubygems-bundler (0.9.0)
tumblr_client (0.6)

@monfresh

I just created a new rvm gemset, created my rails app using this template: https://github.com/RailsApps/rails3-mongoid-omniauth, then installed the omniauth-tumblr and tumblr_client gems, and I can still reproduce the parsing error. Here is the full gem list in my gemset:

actionmailer (3.2.3, 3.2.2)
actionpack (3.2.3, 3.2.2)
activemodel (3.2.3, 3.2.2)
activerecord (3.2.3, 3.2.2)
activeresource (3.2.3, 3.2.2)
activesupport (3.2.3, 3.2.2)
addressable (2.2.7)
arel (3.0.2)
bootstrap-sass (2.0.2)
bson (1.6.2)
bson_ext (1.6.2)
builder (3.0.0)
bundler (1.1.3)
capybara (1.1.2)
childprocess (0.3.1)
coffee-rails (3.2.2)
coffee-script (2.2.0)
coffee-script-source (1.3.1)
crack (0.1.7)
cucumber (1.1.9)
cucumber-rails (1.3.0)
database_cleaner (0.7.2)
diff-lcs (1.1.3)
em-websocket (0.3.6)
email_spec (1.2.1)
erubis (2.7.0)
eventmachine (0.12.10)
execjs (1.3.0)
factory_girl (3.1.0)
factory_girl_rails (3.1.0)
faraday (0.7.6)
faraday-stack (0.1.5)
ffi (1.0.11)
gherkin (2.9.3)
growl (1.0.3)
guard (1.0.1)
guard-bundler (0.1.3)
guard-cucumber (0.7.5)
guard-livereload (0.4.2)
guard-rails (0.1.0)
guard-rspec (0.7.0)
haml (3.1.4)
haml-rails (0.3.4)
hashie (1.2.0)
highline (1.6.11)
hike (1.2.1)
i18n (0.6.0)
journey (1.0.3)
jquery-rails (2.0.2)
json (1.6.6)
launchy (2.1.0)
libwebsocket (0.1.3)
machinist (2.0)
mail (2.4.4)
mime-types (1.18)
mongo (1.6.2)
mongoid (2.4.8)
mongoid-rspec (1.4.4)
multi_json (1.2.0)
multipart-post (1.1.5)
nokogiri (1.5.2)
oauth (0.4.5)
omniauth (1.0.3)
omniauth-oauth (1.0.1)
omniauth-tumblr (1.0)
omniauth-twitter (0.0.9)
polyglot (0.3.3)
rack (1.4.1)
rack-cache (1.2)
rack-ssl (1.3.2)
rack-test (0.6.1)
rails (3.2.3, 3.2.2)
railties (3.2.3, 3.2.2)
rake (0.9.2.2, 0.8.7)
rb-fsevent (0.9.1)
rdoc (3.12)
rspec (2.9.0)
rspec-core (2.9.0)
rspec-expectations (2.9.1)
rspec-mocks (2.9.0)
rspec-rails (2.9.0)
rubygems-update (1.8.21)
rubyzip (0.9.7)
rvm (1.11.3.3)
sass (3.1.15)
sass-rails (3.2.5)
selenium-webdriver (2.21.0, 2.20.0)
simple_form (2.0.1)
sprockets (2.1.2)
term-ansicolor (1.0.7)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
tumblr-rb (1.3.0)
tumblr_client (0.6)
tzinfo (0.3.33)
uglifier (1.2.4)
weary (0.7.2)
will_paginate (3.0.3)
xpath (0.1.4)

@codingjester
Owner

OK cool. I'm going to dig deeper into this later tonight. I appreciate the heads up! :)

@monfresh

However, if I create a new gemset and only install tumblr_client, then the parsing issue does not occur. So, it sounds like maybe an incompatibility with one or more gems from my rails app.

Here is the "clean" gem list:
addressable (2.2.7)
crack (0.1.7)
faraday (0.7.6)
faraday-stack (0.1.5)
highline (1.6.11)
json (1.6.6)
multipart-post (1.1.5)
oauth (0.4.5)
rack (1.4.1)
rake (0.8.7)
rvm (1.11.3.3)
tumblr-rb (1.3.0)
tumblr_client (0.6)
weary (0.7.2)

@codingjester
Owner

Weird! I definitely want to get to the bottom of this. If you find out which gem it's conflicting with, let me know!

@codingjester
Owner

Just fixed this! So closing this out.

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.