🦔

private repository で Authentication failed が起きるのときの対処メモ

2023/01/28に公開

開発によっては repository を分割していてそれらを private repository としてたりするときの対処メモです。

それは突然やってきた。
いつものようにやっていると...

$ bundle install

Fetching gem metadata from https://rubygems.org/........
Fetching https://github.com/xxxxxxxxxx.git

remote: Repository not found.
fatal: Authentication failed for 'https://github.com/xxxxxxxxxx.git/'

Retrying `git clone --bare --no-hardlinks --quiet -- https://:@github.com/xxxxxxxxxx.git
If this error persists you could try removing the cache directory '/Users/xxxxxxxxxx' ...

??
Authentication failed とあるので認証周りで失敗している。

Personal access token の期限が切れていたので作り直した影響なのかな?
開発環境を作り直したりするときに起きたりした。

これは認証情報を再度セットしてあげれば良かった。

$ bundle config set --global https://github.com/xxxxxxxxxx.git <Github user_name>:<Personal access token>

これで通る(はず)。

Discussion