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

Yajl::ParseError: lexical error: invalid character inside string. #1

Closed
targence opened this issue Jun 24, 2012 · 3 comments
Closed

Comments

@targence
Copy link
Contributor

Hi

I'm trying to perform this request @app.groups.getById(gids:"23201, 23202, 23203",fields:"country,city")

It's returning error.

Yajl::ParseError: lexical error: invalid character inside string.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!","screen_name":"club23202","
(right here) ------^

from /Users/.rvm/gems/ruby-1.9.3-p0/gems/yajl-ruby-1.1.0/lib/yajl.rb:36:in `parse'
from /Users/.rvm/gems/ruby-1.9.3-p0/gems/yajl-ruby-1.1.0/lib/yajl.rb:36:in `parse'
from /Users/.rvm/gems/ruby-1.9.3-p0/gems/vkontakte_api-0.2.1/lib/vkontakte_api/api.rb:22:in `call'
from /Users/.rvm/gems/ruby-1.9.3-p0/gems/vkontakte_api-0.2.1/lib/vkontakte_api/resolver.rb:48:in `method_missing'
from (irb):11
from /Users/.rvm/rubies/ruby-1.9.3-p0/bin/irb:16:in `<main>'

Any idea to fix it?

@7even
Copy link
Owner

7even commented Jun 24, 2012

Hello.

Thanks, I was just searching for the API method causing this error. @nemilya found out that VK sometimes returns JSON that Yajl cannot parse. So I'll use another parser in 1.0 version of vkontakte_api which I'm working on currently.

Just checked several parsers with this task, and only Oj succeeded, though it doesn't symbolize keys.

Do you need a quick fix for that? I don't think I'll release 1.0 in a few days so I can do a 0.3 with Oj dependency.

@7even
Copy link
Owner

7even commented Jun 25, 2012

I've fixed the problem in 1.0 branch (by switching to Oj parser), so if you need it right now you can simply put the following in your Gemfile:

# Gemfile
gem 'vkontakte_api', github: '7even/vkontakte_api', branch: '1.0'

@targence
Copy link
Contributor Author

Thanks. It's works for me.

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

2 participants