Post

Github Build 시, Setup Ruby 에러 발생하는 경우

평상시와 동일하게 게시물 작성하고 push를 했는데 다음과 같은 에러가 발생했다.

img01

img02

문제 발생 부분

1
2
3
4
5
6
7
8
9
10
11
An error occurred while installing google-protobuf (3.25.1), and Bundler cannot
continue.

In Gemfile:
  jekyll-theme-chirpy was resolved to 6.3.1, which depends on
    jekyll-archives was resolved to 2.2.1, which depends on
      jekyll was resolved to 4.3.2, which depends on
        jekyll-sass-converter was resolved to 3.0.0, which depends on
          sass-embedded was resolved to 1.69.5, which depends on
            google-protobuf
Error: The process '/opt/hostedtoolcache/Ruby/3.3.0/x64/bin/bundle' failed with exit code 5

문제 원인

이 에러는 google-protobuf gem 설치 중에 발생한 것으로 보인다. 보통 Gem이 native extensions(컴퓨터의 특정 기능을 활용하는 코드)를 포함하고 있을 때 발생하는 문제일 가능성이 높다.

해결 방법

먼저, Ruby 버전을 업데이트 하기 전, homebrew를 최신 버전으로 update 한다.

1
% brew update

Ruby 버전 리스트를 upgrade 한다.

1
% brew upgrade ruby-build

Ruby 설치가 가능한 리스트를 확인한다.

1
2
3
4
5
6
7
% rbenv install -l

3.0.6
3.1.4
3.2.2
3.3.0
...

Ruby 3.2.2 버전으로 Ruby 설치 후, Ruby global 설정을 한다.
Ruby 버전 업데이트하는 방법은 여기 포스터 참고하기(📝Ruby 버전 업데이트하는 방법)

그러고 나서 .github/workflows 에 있는 ruby-version을 global로 설정한 버전으로 수정해준다.

img03

이렇게 다 수정하고 다시 commit을 해주면

img04

This post is licensed under CC BY 4.0 by the author.