vscode-dev-containers icon indicating copy to clipboard operation
vscode-dev-containers copied to clipboard

Syntax error in ruby-debian-sh when rvm is already present

Open agustingianni opened this issue 3 years ago • 3 comments

I think there is a mistake on line 199 of ruby-debian.sh that is triggered whenever there is an existing rvm binary installed.

The offending code is here:

https://github.com/microsoft/vscode-dev-containers/blob/e7ce8bd100eb3e421d18fa316415bc9bcdb94b14/script-library/ruby-debian.sh#L199

The output from vscode is as follows:

 > [3/3] RUN cd /tmp/build-features/local-cache && chmod +x ./install.sh && ./install.sh:
#7 0.227 (*) Script: ruby-debian.sh latest
#7 0.745 RUBY_VERSION=3.1.2
#7 0.747 Ruby Version Manager already exists.
#7 0.747 Installing specified Ruby version.
#7 0.752 bash: -c: line 1: syntax error near unexpected token `&&'
#7 0.752 bash: -c: line 1: `&& rvm install ruby 3.1.2'

agustingianni avatar May 17 '22 08:05 agustingianni

Thanks for opening. Does modifying to move the quote after the && help? i.e. su ${USERNAME} -c && "rvm install ruby ${RUBY_VERSION}"

bamurtaugh avatar Jun 01 '22 17:06 bamurtaugh

I think this just needs the && removed. the su command doesn't have an option for &&. I'm also encountering this issue. reference

DavidBates avatar Jun 02 '22 00:06 DavidBates

Thanks @DavidBates!

@DavidBates @agustingianni would either of you be willing to open a PR in this repo with the suggested change?

bamurtaugh avatar Jun 02 '22 18:06 bamurtaugh