Skip to content

Bug in codedeplouy-agent script - does not select correct ruby #285

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
drzee99 opened this issue May 28, 2021 · 1 comment
Closed

Bug in codedeplouy-agent script - does not select correct ruby #285

drzee99 opened this issue May 28, 2021 · 1 comment

Comments

@drzee99
Copy link

drzee99 commented May 28, 2021

Have ruby2.7 and ruby3.0 installed with /usr/bin/ruby pointing to ruby3.0.

When starting the agent it does select ruby3.0 as the interpreter which does not work.

Looking at bin/codedeploy-agent there is code that is intended to look for a ruby2.Y binary as the interpreter. But its not working correctly as the "if" clause always will (if ruby3.0 is "actual_ruby_version") return TRUE and not branch into the "else" block (it will work correctly though if the default ruby binary is ruby1.x version)

To take both situations into account where /usr/bin/ruby points to ruby1.x or ruby3.x believe the "if" clause should be:

if (actual_ruby_version[0] <=> left_bound[0]) == 0

If ruby1.x or ruby3.x is the default ruby version it will force execution of the "else" clause and start looking for a ruby2.x binary in /usr/bin/

Some distributions may also use ruby-X.Y instead of rubyX.Y this is not taken into account in the startup script it only expects rubyX.Y as naming. To cover those suggest the following additional changes:

ruby_dir = "/usr/bin/ruby*#{i}"
if Dir[ruby_dir].any?

@mwjones-aws
Copy link
Contributor

CodeDeploy Agent 1.6.0 supports Ruby 3.0, 3.1 and 3.2. It has been deployed to most commercial AWS regions as of this comment.

Please track progress on #360

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants