Search code examples
rubyamazon-web-servicesaws-code-deployubuntu-20.04

AWS CodeDeploy-Agenten on Ubuntu 20.0LTS, Ruby errors


I've got some errors, while trying to install the AWS code-deploy agent via :

wget https://bucket-name.s3.region-identifier.amazonaws.com/latest/install

./install auto

I know the AWS documentation said 16.04 or 18.04. But wondering if I am the first who tried it.

Traceback (most recent call last):
    8: from ./install:33:in `<main>'
    7: from ./install:33:in `new'
    6: from /usr/lib/ruby/2.7.0/logger.rb:389:in `initialize'
    5: from /usr/lib/ruby/2.7.0/logger.rb:389:in `new'
    4: from /usr/lib/ruby/2.7.0/logger/log_device.rb:18:in `initialize'
    3: from /usr/lib/ruby/2.7.0/logger/log_device.rb:83:in `set_dev'
    2: from ./install:21:in `method_missing'
    1: from ./install:21:in `map'
./install:22:in `block in method_missing': undefined method `path' for #<IO:<STDOUT>> (NoMethodError)

Would be nice if some one have a tip.

best and thx


Solution

  • Apparently CodeDeploy is not yet compatible with Ubuntu 20.04 since the latter comes with ruby 2.7 while CodeDeploy supports max 2.5. There is a solution here which repacks the deb package to force the check to pass:

    sudo su
    apt-get update
    apt-get install -y ruby
    wget https://aws-codedeploy-us-east-1.s3.amazonaws.com/releases/codedeploy-agent_1.0-1.1597_all.deb
    mkdir codedeploy-agent_1.0-1.1597_ubuntu20
    dpkg-deb -R codedeploy-agent_1.0-1.1597_all.deb codedeploy-agent_1.0-1.1597_ubuntu20
    sed 's/2.0/2.7/' -i ./codedeploy-agent_1.0-1.1597_ubuntu20/DEBIAN/control
    dpkg-deb -b codedeploy-agent_1.0-1.1597_ubuntu20
    dpkg -i codedeploy-agent_1.0-1.1597_ubuntu20.deb
    systemctl start codedeploy-agent
    systemctl enable codedeploy-agent