본문 바로가기
서버/AWS

Ubuntu 22에 CodeDeploy 에이전트 설치 문제 해결하기(Ruby 3)

by for2gles 2022. 11. 5.
반응형

에러

[2022-11-05T07:52:23.713255 #3652] INFO -- : Starting Ruby version check. E, [2022-11-05T07:52:23.713431 #3652] ERROR -- : Current running Ruby version for root is 3.0.2, but Ruby version 2.x needs to be installed. E, [2022-11-05T07:52:23.713456 #3652] ERROR -- : If you already have the proper Ruby version installed, please either create a symlink to /usr/bin/ruby2.x, E, [2022-11-05T07:52:23.713476 #3652] ERROR -- : or run this install script with right interpreter. Otherwise please install Ruby 2.x for root user. E, [2022-11-05T07:52:23.713513 #3652] ERROR -- : You can get more information by running the script with --help option.

 

해결방법

https://github.com/aws/aws-codedeploy-agent/issues/301#issuecomment-1289322582

 

CodeDeploy agent is not supporting ruby v3.0.1 · Issue #301 · aws/aws-codedeploy-agent

When I tried to install codedeploy agent on my server: $ bundle install Fetching gem metadata from http://rubygems.org/........... Resolving dependencies... Bundler found conflicting requirements f...

github.com

 

For anyone who doesn't know how to do anything like me, here's the noob steps:

  1. Enter the following command:
    touch install-code-deploy-ubuntu22-ec2.sh
  2. Enter the following command:
    cat > install-code-deploy-ubuntu22-ec2.sh
  3. Paste the following:
  4. #!/bin/bash
    # This installs the CodeDeploy agent and its prerequisites on Ubuntu 22.04.
    sudo apt-get update
    sudo apt-get install ruby-full ruby-webrick wget -y
    cd /tmp
    wget https://aws-codedeploy-us-east-1.s3.us-east-1.amazonaws.com/releases/codedeploy-agent_1.3.2-1902_all.deb
    mkdir codedeploy-agent_1.3.2-1902_ubuntu22
    dpkg-deb -R codedeploy-agent_1.3.2-1902_all.deb codedeploy-agent_1.3.2-1902_ubuntu22
    sed 's/Depends:.*/Depends:ruby3.0/' -i ./codedeploy-agent_1.3.2-1902_ubuntu22/DEBIAN/control
    dpkg-deb -b codedeploy-agent_1.3.2-1902_ubuntu22/
    sudo dpkg -i codedeploy-agent_1.3.2-1902_ubuntu22.deb
    systemctl list-units --type=service | grep codedeploy
    
  5. Press ctrl + d
  6. Enter the following command:
    chmod u+x install-code-deploy-ubuntu22-ec2.sh
  7. Enter the following command:
    ./install-code-deploy-ubuntu22-ec2.sh
  8. Enter the following command:
    sudo service codedeploy-agent status
반응형

댓글