defunkt / github-gem

`github` command line helper for simplifying your GitHub experience.

Home Page:http://github.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

json_pure error - A JSON text must at least contain two octets! (JSON::ParserError)

kristianmandrup opened this issue · comments

Kristian-Mandrups-MacBook-Air:database_cleaner kmandrup$ gh pull stanislaw master --merge
/Users/kmandrup/.rvm/gems/ruby-1.9.2-p290/gems/json_pure-1.5.3/lib/json/common.rb:148:in `initialize': A JSON text must at least contain two octets! (JSON::ParserError)
    from /Users/kmandrup/.rvm/gems/ruby-1.9.2-p290/gems/json_pure-1.5.3/lib/json/common.rb:148:in `new'
    from /Users/kmandrup/.rvm/gems/ruby-1.9.2-p290/gems/json_pure-1.5.3/lib/json/common.rb:148:in `parse'
    from /Users/kmandrup/.rvm/gems/ruby-1.9.2-p290/gems/github-0.6.2/lib/commands/helpers.rb:406:in `block in load'
    from /Users/kmandrup/.rvm/gems/ruby-1.9.2-p290/gems/github-0.6.2/lib/commands/helpers.rb:345:in `block in load'
    from /Users/kmandrup/.rvm/gems/ruby-1.9.2-p290/gems/github-0.6.2/lib/commands/helpers.rb:326:in `block in load'
    from /Users/kmandrup/.rvm/gems/ruby-1.9.2-p290/gems/github-0.6.2/lib/commands/commands.rb:118:in `block in load'
    from /Users/kmandrup/.rvm/gems/ruby-1.9.2-p290/gems/github-0.6.2/lib/github/command.rb:25:in `call'
    from /Users/kmandrup/.rvm/gems/ruby-1.9.2-p290/gems/github-0.6.2/lib/github.rb:76:in `invoke'
    from /Users/kmandrup/.rvm/gems/ruby-1.9.2-p290/gems/github-0.6.2/lib/github.rb:70:in `activate'
    from /Users/kmandrup/.rvm/gems/ruby-1.9.2-p290/gems/github-0.6.2/bin/gh:8:in `'
    from /Users/kmandrup/.rvm/gems/ruby-1.9.2-p290/bin/gh:19:in `load'
    from /Users/kmandrup/.rvm/gems/ruby-1.9.2-p290/bin/gh:19:in `'

+1

My issue was that my github config in ~/.gitconfig was corrupt. Re-config by:

$ git config --global github.user "your-github-username"
$ git config --global github.token "your-github-token"

Same as #39 (comment)

I just updated my ~/.gitconfig, and I am still having the same issue.

I think that my credentials were just invalid. (when you change your
password, your api credentials change as well). It's working fine now.

φ

On Thu, Sep 15, 2011 at 16:51, Jamison Dance
reply@reply.github.com
wrote:

I just updated my ~/.gitconfig, and I am still having the same issue.

Reply to this email directly or view it on GitHub:
#69 (comment)

As I note in the duplicate issue: "I had this very frustrating issue for a long time (is spewing a stack trace really the best error message available?) and finally fixed it by removing GITHUB_USER and GITHUB_TOKEN from my gitconfig and hardcoding my actual credentials."

@kristianmandrup wanna close this issue since it's a duplicate of #39?

The github gem will drop an invalid empty "network cache" file at .git/network-cache if the credentials are busted. Remove it, fix your credentials, then try.