$ gem install bundler:2.2.21
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
bad response Unauthorized 401 (https://bart_simpson:[email protected]/private_org/api/v1/dependencies?gems=bundler)
和
$ gem update --system
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
bad response Unauthorized 401 (https://bart_simpson:[email protected]/private_org/specs.4.8.gz)
我在两个地方设置了一个良好的个人令牌(良好 = 完全权限,且未过期):
$ cat ~/.bundle/config
---
BUNDLE_RUBYGEMS__PKG__GITHUB__COM: "bart_simpson:ghp_nJabIP9JjPe7KOwgDrkiJextJggm114MZh7f"
BUNDLE_HTTPS://RUBYGEMS__PKG__GITHUB__COM/PRIVATE_ORG/: "bart_simpson:ghp_nJabIP9JjPe7KOwgDrkiJextJggm114MZh7f"
和
$ cat ~/.gem/credentials
---
:github: Bearer ghp_nJabIP9JjPe7KOwgDrkiJextJggm114MZh7f
啊!生成新的个人令牌并将其保存在问题中提到的两个位置后,我忘记了第三个位置(它起到了作用)......
$ cat ~/.gemrc
---
:backtrace: false
:bulk_threshold: 1000
:sources:
- https://rubygems.org/
- https://bart_simpson:[email protected]/private_org/
:update_sources: true
:verbose: true