File tree Expand file tree Collapse file tree 2 files changed +29
-11
lines changed Expand file tree Collapse file tree 2 files changed +29
-11
lines changed Original file line number Diff line number Diff line change @@ -16,17 +16,8 @@ ENV GEM_HOME=/home/gitpod/.rvm
16
16
ENV GEM_PATH=$GEM_HOME:$GEM_PATH
17
17
ENV PATH=/home/gitpod/.rvm/bin:$PATH
18
18
19
- # the version of openssl changed in Jammy, some versions of Ruby need an older version
20
- # https://github.com/rvm/rvm/issues/5209#issuecomment-1114159447
21
- # another option: https://github.com/rvm/rvm/issues/5209#issuecomment-1134927685 or sudo apt install libssl-dev=1.1.1l-1ubuntu1.4
22
- RUN bash -lc " \
23
- rvm requirements \
24
- && rvm pkg install openssl \
25
- && rvm install ${RUBY_VERSION} --with-openssl-dir=$HOME/.rvm/usr --default \
26
- && rvm alias create default $RUBY_VERSION \
27
- && rvm rubygems current \
28
- && gem install bundler --no-document \
29
- && gem install solargraph --no-document"
19
+ ADD ./install.sh /tmp
20
+ RUN /tmp/install.sh $RUBY_VERSION
30
21
31
22
RUN echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*' >> /home/gitpod/.bashrc.d/70-ruby
32
23
RUN echo "rvm_gems_path=/workspace/.rvm" > ~/.rvmrc
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -euo pipefail
3
+
4
+ RUBY_VERSION=$1
5
+
6
+ # the version of openssl changed in Jammy, Ruby 3.0 needs an older version
7
+ # https://github.com/rvm/rvm/issues/5209#issuecomment-1114159447
8
+ # another option: https://github.com/rvm/rvm/issues/5209#issuecomment-1134927685 or sudo apt install libssl-dev=1.1.1l-1ubuntu1.4
9
+ if grep -q " 3.0." <<< " ${RUBY_VERSION}" ; then
10
+ bash -lc "
11
+ rvm requirements \
12
+ && rvm pkg install openssl \
13
+ && rvm install \" ${RUBY_VERSION} \" --with-openssl-dir=\" ${HOME} \" /.rvm/usr --default \
14
+ && rvm alias create default \" ${RUBY_VERSION} \" \
15
+ && rvm rubygems current \
16
+ && gem install bundler --no-document \
17
+ && gem install solargraph --no-document"
18
+ else
19
+ # Ruby 3.1 and higher do not
20
+ bash -lc "
21
+ rvm requirements \
22
+ && rvm install \" ${RUBY_VERSION} \" --default \
23
+ && rvm alias create default \" ${RUBY_VERSION} \" \
24
+ && rvm rubygems current \
25
+ && gem install bundler --no-document \
26
+ && gem install solargraph --no-document"
27
+ fi
You can’t perform that action at this time.
0 commit comments