Skip to content

Provide switch_ruby.sh script #937

Open
@abitrolly

Description

Is your feature request related to a problem? Please describe

I'm always frustrated when Gitpod build fails and I can't understand what is written .gitpod.Dockerfile, or when I need to copy-paste such code.

https://github.com/gitpod-io/website/pull/2836 modifies instructions for using a different version of Ruby https://www.gitpod.io/docs/introduction/languages/ruby

FROM gitpod/workspace-full
USER gitpod

# Install Ruby version 2.7.6 and set it as default
RUN _ruby_version=ruby-2.7.6 \
    && printf "rvm_gems_path=/home/gitpod/.rvm\n" > ~/.rvmrc \
    && bash -lc "rvm reinstall ${_ruby_version} && \
                 rvm use ${_ruby_version} --default" \
    && printf "rvm_gems_path=/workspace/.rvm" > ~/.rvmrc \
    && printf '{ rvm use $(rvm current); } >/dev/null 2>&1\n' >> "$HOME/.bashrc.d/70-ruby"

Instead of forcing people to copy-paste bash lines, it would be more convenient to provide a helper script switch_ruby.sh <version> that does the setup.

Describe the behaviour you'd like

FROM gitpod/workspace-full
USER gitpod

# Install Ruby version 2.7.6 and set it as default
RUN /home/gitpod/switch_ruby.sh 2.7.6

I am not sure what's the best path to place it.

Describe alternatives you've considered

An alternative is to call the script from .gitpod.yml.

Actually, I'd like to install Ruby from any image. Like from Node image.

Additional context

https://gitlab.com/gitlab-org/gitlab-docs/-/merge_requests/3147 (lots of text)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions