[Ruby] rbenv

less than 1 minute read

rbenv

  • Ruby Version Manager


Install via Basic GitHub Checkout

  • Clone rbenv via git
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
  • Optionally, try to compile dynamic bash extension to speed up rbenv.
    Don’t worry if it fails; rbenv will still work normally
cd ~/.rbenv/src
./configure
cd ~/.rbenv
make -C src
  • Shell Profile 파일에 다음 코드 추가 (ex. ~/.zshrc)
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init - zsh)"



Command

  • 입력시 간략한 설명이 나온다.
rbenv -h
  • 설치가능한 버전 리스트를 보여준다.
rbenv install -l
  • 설치되어있는 Ruby 버전 리스트를 보여준다.
rbenv versions
  • 현재 활성화된 Ruby 버전을 보여준다.
rbenv version
  • Ruby 해당버전 설치
rbenv install ${VERSION}
  • Ruby 해당버전 제거
rbenv uninstall ${VERSION}
  • Ruby Default 버전 설정
rbenv global ${VERSION}

Ruby Shell 버전 설정

rbenv shell ${VERSION}
  • Ruby Shell 버전 설정해제
rbenv shell --unset
  • Ruby Local Versions 설정 (.ruby-version를 해당 로컬에 생성한다.)
rbenv local ${VERSION}
  • Ruby Local Versions 설정해제 (.ruby-version 파일 삭제)
rbenv local --unset
  • 환경 재설정 (변경사항 발생시 사용권장)
rbenv rehash



Reference

Leave a comment