It’s relatively easy to set up your Ruby project in Gitpod.
As of this writing, Gitpod comes with Ruby 2.7.6 pre-installed in the gitpod/workspace-full.
To use a more recent Ruby version, you can change the base image to one of the following:
These images are automatically updated every week with the latest ruby patch versions (3.0.x and 3.1.x).
To use another version, you may use a custom Dockerfile.
FROM gitpod/workspace-full USER gitpod # Install Ruby version 3.1.1 and set it as default RUN echo "rvm_gems_path=/home/gitpod/.rvm" > ~/.rvmrc RUN bash -lc "rvm install ruby-3.1.1 && \ rvm use ruby-ruby-3.1.1 --default" RUN echo "rvm_gems_path=/workspace/.rvm" > ~/.rvmrc
💡 Explanation: Gitpod initially sets up RVM in
/home/gitpod/.rvm, but then later switches the RVM configuration directory to
/workspace/.rvm, so that any user-made changes (like installing new gems) are persisted within a Gitpod workspace. However, during the Dockerfile build, the
/workspacedirectory doesn’t exist yet, so we temporarily reset RVM’s configuration directory to
Here are a few Ruby example projects that are already automated with Gitpod:
Here are a few useful extensions that you’ll likely want to install in your Ruby project.
With the Ruby test explorer, you can run unit tests from within the Gitpod UI. To add this extension to your repository, simply add these lines to your .gitpod.yml configuration file:
vscode: extensions: - firstname.lastname@example.org - email@example.com
So, you want to write your cool new Ruby On Rails application in Gitpod? Well, here is an idea of how to do it. Please take a look at our minimal Rails example running in Gitpod: