티스토리 뷰
jekyll 설치 오류 You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.
개발하는 후딘 2022. 7. 6. 18:56[문제 내용]
github.io 블로그를 만들려고 jekyll을 설치하려다가
gem 권한이 없어서 jekyll 다운로드 실패했습니다.
$ gem install jekyll bundler
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.
* 필자 노트북사양
macbook pro (retina 13-inch / 메모리 8GB / intel Core i5 프로세서)
[해결방법]
물론 구글링으로 해결을 했습니다만 그래도 해결방법을 기록하겠습니다 :)
자세한 설명은 맨아래 참고사이트에서 확인해주시면 됩니다.
노파심으로 설명을 드리자면
'$'는 터미널 명령어 를 나타냅니다. 쉘을 열어서 $을 제외한 명령어를 입력하면 됩니다.
$ brew update
$ brew install rbenv ruby-build
$ rbenv versions
설치가 되지 않은 상태라면, * system 이라고 나옵니다.
$ rbenv install -l
설치할 루비 버젼을 나타냅니다. 필자는 2.6.10 버젼을 설치했습니다.
$ rbenv install 2.6.10
설치후 버젼확인합니다. 설치가되면 *system 밑에 설치한 버젼이 생깁니다.
$ rbenv versions
system
* 2.6.10 (set by /Users/seokangchoi/.rbenv/version)
.bashrc (bash 쉘스크립트)에 추가합니다.
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
$ vim ~/.bashrc
( .bashrc에 추가내용은 바로밑 라인입니다 )
eval "$(rbenv init -)"
.bashrc에 입력한 코드를 적용시킵니다.
$ source ~/.bashrc
$ rbenv global 2.6.10
현재 ruby의 위치를 조회해봅니다. /usr/bin/ruby 가 나오지 않도록합니다.
$ which ruby
/Users/user-name/.rbenv/shims/ruby
$ rbenv rehash
rehash 는 모든 ruby 실행파일들을 rbenv로 (~/.rbenv/versions/*/bin/*) shims 를 설치하는 역할입니다.
gem을 설치할 수 있도록합니다
gem 명령어를 다시 시도해봅니다.
$ gem install bundler
Fetching bundler-2.3.17.gem
Successfully installed bundler-2.3.17
Parsing documentation for bundler-2.3.17
Installing ri documentation for bundler-2.3.17
Done installing documentation for bundler after 0 seconds
1 gem installed
[추가1]
* 터미널을 종료하거나 새로운 터미널에서는 gem 권한을 받지 않으므로 .bashrc를 적용 후에 gem 커맨드가 정상적으로 됩니다.
$ source ~/.bashrc
$ gem install bundler jekyll
Successfully installed bundler-2.3.17
Parsing documentation for bundler-2.3.17
Done installing documentation for bundler after 0 seconds
Successfully installed jekyll-4.2.2
Parsing documentation for jekyll-4.2.2
Done installing documentation for jekyll after 0 seconds
2 gems installed
[추가2] which ruby 명령어로 ruby의 위치가 다르게 표기됩니다.
초기 터미널(새로 추가한 터미널)일 때 which ruby 명령어 결과
$ which ruby
/usr/bin/ruby
.bashrc 를 적용시킬 때 which ruby 명령어 결과
$ which ruby
/Users/seokangchoi/.rbenv/shims/ruby
.rbenv/shims/ruby 일때 gem 커맨드 명령어가 사용가능합니다.
[참고]
https://stackoverflow.com/a/66379795
You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory. (mac user)
below is what I need to do. To run the specs, you'll need to install RSpec. First, run gem install bundler in the root directory of your project. Then, run bundle install. To run a single spec fil...
stackoverflow.com
https://github.com/rbenv/rbenv
GitHub - rbenv/rbenv: Manage your app's Ruby environment
Manage your app's Ruby environment. Contribute to rbenv/rbenv development by creating an account on GitHub.
github.com
https://jojoldu.tistory.com/288
맨처음 검색에 참고하고 따라해봤는데 실패했어요 ㅠㅠ 그러나 .zsh을 사용하시는분들에게는 권장합니다.
Mac에서 Gem::FilePermissionError 에러 발생시 해결 방법
Mac에서 Ruby의 패키지 매니저인 gem을 통해 설치를 진행하다 다음과 같은 에러를 만납니다. $ gem install bundler ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permission..
jojoldu.tistory.com
'Backend > 꾸준히 TIL' 카테고리의 다른 글
jekyll new 명령어에서 conflict가 일어났을 때 (0) | 2022.07.08 |
---|---|
git cli 명령어 에러 해결 - remote: Support for password authentication was removed on (0) | 2022.07.07 |
git Commit, Push, Pull 명령어 (0) | 2022.06.13 |
git config (0) | 2022.06.12 |
SSH 프로토콜을 알아보자 (0) | 2022.06.11 |
- Total
- Today
- Yesterday
- nestjs jest
- 나도 할 수 있다
- node.js
- 갓생살자
- Jekyll
- 참고
- 습관개선
- 한달독서
- 바이트디그리
- OS
- RDBMS
- TypeScript
- jest
- 미완
- IT용어
- Mongoose
- typeORM
- 스마트폰중독
- gem
- Nest.js
- 디지털디톡스
- MongoDB
- 한달어스
- MySQL
- 클린아키텍쳐
- TDD
- git
- vscode
- nestjs
- 개발용어
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |