Can't install Ruby on CodeBuild

0

Hi, It seems that whatever I do I can't get CodeBuild to build my Ruby project. I need Ruby version 2.7.4 so as always I added .ruby-version file in the root folder of my app with ruby-2.7.4 but the build fails with error:

rbenv: version `ruby-2.7.4' is not installed 

I set ruby-2.6 in my .ruby-version but the build fails again with error

rbenv: version `ruby-2.6' is not installed 

I tried installing proper Ruby version at build so I set this command:

pre_build:
    commands:
      - rbenv install 2.7.4

but I get the same error:

rbenv: version `ruby-2.6' is not installed

What am I doing wrong? What am I missing?

  • Which build image are you using? I was able to do this with aws/codebuild/amazonlinux2-x86_64-standard:3.0

  • I am using aws/codebuild/amazonlinux2-x86_64-standard:3.0 When I set ruby: 2.7.4 I get an error

    Phase context status code: YAML_FILE_ERROR Message: Unknown runtime version named '2.7.4' of ruby. This build image has the following versions: 2.6, 2.7
    
jedrek
질문됨 2년 전101회 조회
답변 없음

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠