1

I'm trying to run the following command:

bundle install

But the output is:

root@b431398437b1:/hermes-app# bundle install
Your RubyGems version (2.7.6.2) has a bug that prevents `required_ruby_version` from working for Bundler. Any scripts that use `gem install bundler` will break as soon as Bundler drops support for your Ruby version. Please upgrade RubyGems to avoid future breakage and silence this warning by running `gem update --system 3.2.3`
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
Your Ruby version is 2.5.5, but your Gemfile specified 3.1.1

So, i wanna install rvm, rbenv or ruby-build for change the version, but all of them throw me an error. Anyone know's how to change the version using Dockerfile? Thanks in advance.

Here is my Dockerfile:

FROM debian:buster

# Install system dependencies
RUN apt-get update && apt-get install -y \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common \
    gnupg \
    gpg-agent \
    ruby-full

# Create the workspace into the container
RUN mkdir -p /hermes-app && \
    chmod -R 777 /hermes-app
WORKDIR /hermes-app
COPY srcs/ /hermes-app/

# Install ruby dependencies
RUN gem install bundler
RUN bundle install
  • 1
    I would start from an official ruby image, instead of installing ruby via apt. See https://hub.docker.com/_/ruby?tab=tags&page=1&name=3.1.1 – baseballlover723 Aug 03 '22 at 04:52
  • related: https://stackoverflow.com/questions/74695464/why-cant-i-install-ruby-3-1-2-in-linux-docker-container?noredirect=1#comment131843536_74695464 – Charlie Parker Dec 06 '22 at 21:28

0 Answers0