bundle命令提示无法登录github

时间:2019-09-24 20:22:26

标签: ruby git github rubygems bundler

当我运行捆绑软件时,我得到了这个信息:

$ bundle
Following files may not be writable, so sudo is needed:
  /Library/Ruby/Gems/2.3.0
  /Library/Ruby/Gems/2.3.0/build_info
  /Library/Ruby/Gems/2.3.0/cache
  /Library/Ruby/Gems/2.3.0/doc
  /Library/Ruby/Gems/2.3.0/extensions
  /Library/Ruby/Gems/2.3.0/gems
  /Library/Ruby/Gems/2.3.0/specifications
Fetching https://github.com/lsegal/yard.git
Fetching https://github.com/lsegal/yard-js.git
Fetching https://github.com/lsegal/parsejs.git
Username for 'https://github.com': me
Password for 'https://me@github.com': 
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/lsegal/parsejs.git/'

Retrying `git clone 'https://github.com/lsegal/parsejs.git' "/Users/me/.bundle/cache/git/parsejs-35f0b5a29373e174672dd4f95a4392093a2ddf51" --bare --no-hardlinks --quiet` due to error (2/4): Bundler::Source::Git::GitCommandError Git error: command `git clone 'https://github.com/lsegal/parsejs.git' "/Users/me/.bundle/cache/git/parsejs-35f0b5a29373e174672dd4f95a4392093a2ddf51" --bare --no-hardlinks --quiet` in directory /Users/paulcarron/git/ibm-cos-sdk-js has failed.
Username for 'https://github.com': me
Password for 'https://me@github.com': 
remote: Repository not found.
fatal: repository 'https://github.com/lsegal/parsejs.git/' not found

Retrying `git clone 'https://github.com/lsegal/parsejs.git' "/Users/me/.bundle/cache/git/parsejs-35f0b5a29373e174672dd4f95a4392093a2ddf51" --bare --no-hardlinks --quiet` due to error (3/4): Bundler::Source::Git::GitCommandError Git error: command `git clone 'https://github.com/lsegal/parsejs.git' "/Users/me/.bundle/cache/git/parsejs-35f0b5a29373e174672dd4f95a4392093a2ddf51" --bare --no-hardlinks --quiet` in directory /Users/paulcarron/git/ibm-cos-sdk-js has failed.
Username for 'https://github.com':

我使用相同的用户名通过浏览器登录GitHub,所以不知道发生了什么。有人可以帮忙吗?

1 个答案:

答案 0 :(得分:0)

您需要创建一个 Github Token 才能通过命令行 API 访问。转到 Settings -> Developer Settings -> Access Tokens 并创建一个新令牌。

我不完全确定您需要哪种套装。我给了自己 repo(全部)、write:packagesread:packagesworkflow,因为这就是我想要的令牌。我的猜测是 read:packages 就足够了。

然后,您可以在 bundle 提示时提供您的普通 Github 用户名和这个新令牌。