ken-rb
ken-rb copied to clipboard
JSON read return error
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.
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
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
also installing with git path not working
Not able to get anything done because of this issue, although API wrapper looks quite full fledged :(
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 :)