github-gem
github-gem copied to clipboard
json parse error
gh network list
/Library/Ruby/Gems/1.8/gems/json-1.4.6/lib/json/common.rb:146:in initialize': A JSON text must at least contain two octets! (JSON::ParserError) from /Library/Ruby/Gems/1.8/gems/json-1.4.6/lib/json/common.rb:146:innew'
from /Library/Ruby/Gems/1.8/gems/json-1.4.6/lib/json/common.rb:146:in parse' from /Library/Ruby/Gems/1.8/gems/github-0.5.0/lib/commands/helpers.rb:400:inget_cache'
In my case, I hadn't told git about my github credentials. From github-gem's readme:
Authentication
To let GitHub know who you are, just have your git config set up with your GitHub username and token.
$ git config --global github.user "your-github-username"
$ git config --global github.token "your-github-token"
You can find your token under your account.
After setting that up, gh network list worked smoothly.
I still see this issue, even after adding those configs. Happens in ruby 1.8.7 and 1.9.2 with github gem versino 0.6.2.
I also get this error.
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.
I'm having the same problem. None of the proposed solutions work for me.
Same error.
Issue here too with ruby 1.9.2p290, json 1.6.5, json-pure 1.5.4 and github 0.6.2
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.
Same error for me, tried with multiple repositories, both personal and part of an organisation.
I tried removing the .git/network_cache file also but it still doesn't work
This issue isn't relevant currently because the network list command doesn't work at all since GitHub deprecated the v2 API.