Ruby 버전 업데이트하기
기존에 사용했던 블로그 테마에 추가 기능이 많이 올라와 업데이트를 하고자 했다.
최신 theme 깃을 다운로드 받아 필요한 파일들을 기존 파일에 대치시켰고 로컬에 실행을 했더니 다음과 같은 문제가 발생했다.
1
2
3
4
5
6
% bundle exec jekyll serve
Could not find gem 'html-proofer (~> 4.4)' in locally installed gems.
The source contains the following gems matching 'html-proofer':
* html-proofer-3.19.4
Run `bundle install` to install missing gems.
일단 위에서 시키는대로 bundle install
명령어를 실행해줬다.
1
2
3
4
5
6
7
8
9
10
% bundle install
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Bundler found conflicting requirements for the Ruby version:
In Gemfile:
jekyll-theme-chirpy was resolved to 6.3.1, which depends on
Ruby (>= 3.0)
Current Ruby version:
Ruby (= 2.7.0)
현재 내 Ruby 버전은 2.7.0 인데, 3.0 이상의 Ruby가 필요하여 발생한 문제였다.
설치 가능한 Ruby 버전 확인
1
% rbenv install -l
먼저 설치 가능한 버전 리스트를 확인하였고, 3.0.4 설치를 진행했다.
Ruby 설치
1
2
% rbenv install 3.0.4
% rbenv versions
3.0.4 를 설치 후, 설치된 Ruby 버전 리스트를 확인해줬다.
3.0.4 버전은 잘 설치 되었고 이제 해당 버전으로 세팅해주면 된다.
Ruby global 설정
1
% rbenv global 3.0.4
global ruby 설정 후, 사용하는 터미널에게 rbenv path
를 추가하여 저장 및 적용한다.
1
2
3
4
5
6
7
8
% vi ~/.zshrc
[[ -d ~/.rbenv ]] && \
export PATH=${HOME}/.rbenv/bin:${PATH} && \
eval "$(rbenv init -)"
# vi 저장 후, 적용
% source ~/.zshrc
세팅 후 확인해 보니 잘 적용되어 있다.
bundler 재설치
1
2
3
% gem install bundler
% gem install jekyll bundler
% bundle install
이렇게 순차적으로 install 해주면 업데이트 완료된다!
bundle exec jekyll serve
하면 로컬에서 실행이 잘 되는 걸 확인할 수 있다.
This post is licensed under CC BY 4.0 by the author.