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

JSON read return error #9

Open
pmackay opened this issue Sep 1, 2012 · 5 comments
Open

JSON read return error #9

pmackay opened this issue Sep 1, 2012 · 5 comments

Comments

@pmackay
Copy link

pmackay commented Sep 1, 2012

I've just downloaded this library and tested the simple "new_order" example. I get this:

/Library/Ruby/Gems/1.8/gems/json-1.7.5/lib/json/common.rb:155:in `initialize': A JSON text must at least contain two octets! (JSON::ParserError)
    from /Library/Ruby/Gems/1.8/gems/json-1.7.5/lib/json/common.rb:155:in `new'
    from /Library/Ruby/Gems/1.8/gems/json-1.7.5/lib/json/common.rb:155:in `parse'
    from /Library/Ruby/Gems/1.8/gems/ken-0.2.1/lib/ken/session.rb:146:in `get_query_response'
    from /Library/Ruby/Gems/1.8/gems/ken-0.2.1/lib/ken/session.rb:92:in `mqlread'
    from /Library/Ruby/Gems/1.8/gems/ken-0.2.1/lib/ken/resource.rb:23:in `get'
    from /Library/Ruby/Gems/1.8/gems/ken-0.2.1/lib/ken.rb:121:in `get'

It appears that the response is empty from Freebase.

@pshoukry
Copy link

pshoukry commented Sep 2, 2012

I was having the same issue when deployed via GEM but appears to be working properly when checked out from git:
try to add

gem 'ken', :git => "git://github.com/michael/ken-rb.git"

to your gemfile

@pmackay
Copy link
Author

pmackay commented Sep 20, 2012

Do you know any way to avoid getting this, after running "bundle install":

/Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `gem_original_require': no such file to load -- ken (LoadError)
    from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `require'
    from ken-test.rb:3

@cagdasolgun
Copy link

also installing with git path not working

@abhishek77in
Copy link

Not able to get anything done because of this issue, although API wrapper looks quite full fledged :(

@deevis
Copy link

deevis commented Jan 27, 2014

I just got this same issue __ A JSON text must at least contain two octets! __

I set the debug level to Ken::Logger.new(STDOUT, :debug) to try and glean some information. It did spit out the URL it was hitting, but nothing else really useful.

I ran the url via curl and, low and behold, it was a 404 error. So I double checked my url and changed it to the correct url.

I had been using http://www.freebase.com and then switched to use the current https://www.googleapis.com/freebase/v1

Now all's good :)

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

5 participants