๊ฐœ๋ฐœ ๐Ÿพ/Error

mac ์—์„œ rbenv install ์—๋Ÿฌ ํ•ด๊ฒฐ : ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.

JOTOKKI 2023. 6. 10. 16:21
728x90

mac ์—์„œ react-native ํ™˜๊ฒฝ ์„ธํŒ… ๊ณผ์ •์—์„œ rbenv ๋ฅผ ์„ค์น˜ํ•ด์•ผํ•˜๋Š”๋ฐ, 

rbenv ๊นŒ์ง€ ์„ค์น˜ ์ดํ›„ bundler๋ฅผ ์„ค์น˜ํ•˜๋Š” ๊ณผ์ •์—์„œ ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์—๋Ÿฌ๋ฅผ ๋งŒ๋‚ฌ๋‹ค. 

ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.

๊ฒ€์ƒ‰ ๋์— ์ฐพ์€ ๋ฐฉ๋ฒ•์€ ์„ค์น˜์ดํ›„ .zshrc ์— ํ™˜๊ฒฝ๋ณ€์ˆ˜๋ฅผ ์ถ”๊ฐ€ํ•ด์ค˜์•ผ ํ•œ๋‹ค๋Š” ๊ฑธ ๊นจ๋‹ฌ์•˜๋‹ค. ใ…Ž

 

vim ~/.zshrc // .zshrc ํŒŒ์ผ ์—ด๊ธฐ 

// ํ•ด๋‹น ํŒŒ์ผ์—์„œ ์•„๋ž˜ ์ฝ”๋“œ ์ถ”๊ฐ€ (์ถ”๊ฐ€: i, ์ €์žฅ+๋‹ซ๊ธฐ๋Š” : wq) 
[[ -d ~/.rbenv  ]] && \
  export PATH=${HOME}/.rbenv/bin:${PATH} && \
  eval "$(rbenv init -)"
  
  source ~/.zshrc // ๋ณ€๊ฒฝ๋œ ์ฝ”๋“œ ์ ์šฉ

 

์ดํ›„ ๋‹ค์‹œ ๋ฒˆ๋“ค๋Ÿฌ๋ฅผ ์„ค์น˜ํ•˜๋ฉด ์ž˜ ์„ค์น˜๋œ๋‹ค. 

 

๋ฐ˜์‘ํ˜•