Macbook

Mac에서 Homebrew에 GitHub API Token 설정하기

후뤼한잉여 2016. 1. 9. 22:37

Mac에서 Homebrew에 GitHub API Token 설정하기

1. 개요

homebrew를 너무 많이 사용하다 보면 익명사용자에 대한 GitHub API 제한에 걸리게 됩니다.
이런 문제를 해결한 내용을 정리하고자 문서로 남깁니다.

Error: GitHub API rate limit exceeded for XX.YY.AA.BB. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)
Try again in 20 minutes 53 seconds, or create an API token:
https://github.com/settings/tokens/new?scopes=&description=Homebrew
and then set HOMEBREW_GITHUB_API_TOKEN.

2. GitHub 설정

  1. 에러 문구에 나온 API 호출 (웹 페이지 접속)
    https://github.com/settings/tokens/new?scopes=&description=Homebrew
    
  2. [Generate token] 버튼을 클릭하여 토큰을 생성한다.
  3. Token이 보인다면 메모장등에 따로 적어놓는다.
    • 만약 Token이 보이지 않는다면 토큰 옆에 [Edit]버튼을 클릭 후, [Regenerate token]버튼을 클릭하여 토큰을 다시 생성한다.

3. Mac 설정하기

  1. terminal 접속
  2. vi로 profile파일을 열어 내용 추가
    vi ~/.bash_profile
    
    추가할 내용
    export HOMEBREW_GITHUB_API_TOKEN=[발급받은 토큰번호]
    
  3. profile 적용하기
    source .bash_profile