Install any Ruby version in minutes with mise

When you’re getting started with Ruby, setting up ruby in your development environment is one of the most important tasks.

As you start creating or modifying projects, managing different versions and configuring dependencies can become a challenging task.

Fortunately, you can use mise-en-place to get started in minutes instead of hours. The tool provides a consistent way to setup and interact with your projects no matter what language they’re written in.

mise supports hundreds of dev tools, including ruby. Below is a 3 step process to get you up and running in less than 15 minutes:

1. Install mise

curl https://mise.run | sh

After the script finishes, you’ll get a message like this:

mise: installed successfully to $HOME/.local/bin/mise
mise: run the following to activate mise in your shell:
echo "eval \"\$($HOME/.local/bin/mise activate zsh)\"" >> "$HOME/.zshrc"

mise: run `mise doctor` to verify this is setup correctly

2. Activate

Copy and run the script in your shell to activate mise in ZSH:

echo "eval \"\$($HOME/.local/bin/mise activate zsh)\"" >> "$HOME/.zshrc"

3. Use

Navigate to your project directory:

cd your-project

Run the following command to install the version of ruby that your project requires. For example:

mise use ruby@3.4.5

After completion, you’ll see the following output:

mise ruby@3.4.5 ✓ installed                                                                                                                                                         mise ~/your-project/mise.toml tools: ruby@3.4.5

You’re now ready to start using any version of ruby in your projects!

If you want to learn more about it or use more advanced features, I recommend getting familiar with the tool by watching the 3 min demo and explore the Getting Started and Walkthrough sections in the documentation.

If you run into any problem or have questions about the process, you can leave a comment below.

3 Likes

My recently favourite thing with mise is how easy it it to test things with a different version of Ruby. For example, if I do this:

mise x ruby@jruby-10.0.3.0 -- bundle exec rake test

it will run the tests on JRuby, but without affecting the selected version for the project - so I don’t need to remember to change the version back.

I suspect it is possible with other version managers too, but I only discovered it with mise so far :smiley:

3 Likes

That’s a great feature for sure. Testing code with different versions/engines without affecting the current project configuration can be very convenient. Have you used mise on CI build too?

Not really. I just use a build matrix with different versions.