rbenv - RLidea/dev.docs GitHub Wiki

์‹œ์Šคํ…œ ruby๋ฅผ ์ด์šฉํ•˜๊ณ  ์žˆ๊ธฐ ๋•Œ๋ฌธ์— ๊ถŒํ•œ์ด ์—†์–ด gem ์„ค์น˜๊ฐ€ ์•ˆ๋œ๋‹ค. sudo๋ฅผ ํ†ตํ•ด root ๊ถŒํ•œ์œผ๋กœ ์‹คํ–‰ํ•˜๋ฉด ์„ค์น˜ํ•  ์ˆ˜ ์žˆ์ง€๋งŒ, ๋ณด์•ˆ์ƒ ๊ถŒ์žฅํ•˜์ง€ ์•Š๋Š” ์„ค์น˜๋ฒ•์ด๋‹ค. ๋”ฐ๋ผ์„œ rbenv๋ฅผ ์ด์šฉํ•ด ruby๋ฅผ ์ง์ ‘ ์„ค์น˜ํ•˜๊ณ  ๋‹ค๋ค„๋ณด์ž.

rbenv์„ค์น˜

brew update
brew install rbenv ruby-build
rbenv versions

ruby์„ค์น˜

rbenv install -l  # ๋ฒ„์ „ํ™•์ธ
rbenv install <ruby version>

global ruby version ์„ system์—์„œ ๋ฐฉ๊ธˆ ์„ค์น˜ํ•œ ๋ฒ„์ „์œผ๋กœ ๋ณ€๊ฒฝ

rbenv PATH ์ถ”๊ฐ€

vi .bashrc, vi .zshrc ๋“ฑ.. ์ž์‹ ์ด ์‚ฌ์šฉํ•˜๋Š” ์‰˜์— ์•„๋ž˜์˜ ๋‚ด์šฉ์„ ์ž…๋ ฅ.

[ -d ~/.rbenv  ](/RLidea/dev.docs/wiki/--d-~/.rbenv--) && \
  export PATH=${HOME}/.rbenv/bin:${PATH} && \
  eval "$(rbenv init -)"

source ~/.bashrc , source ~/.zshrc ๋“ฑ์œผ๋กœ ์ ์šฉํ•œ๋‹ค.

ruby ๋ฒ„์ „ ๋ณ€๊ฒฝ

rbenv versions
rbenv global <ruby version>