ken-rb icon indicating copy to clipboard operation
ken-rb copied to clipboard

JSON read return error

Open pmackay opened this issue 13 years ago • 5 comments

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.

pmackay avatar Sep 01 '12 09:09 pmackay

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

pshoukry avatar Sep 02 '12 11:09 pshoukry

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

pmackay avatar Sep 20 '12 11:09 pmackay

also installing with git path not working

cagdasolgun avatar Jun 11 '13 08:06 cagdasolgun

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

abhishek77in avatar Jan 12 '14 20:01 abhishek77in

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 :)

deevis avatar Jan 27 '14 05:01 deevis