From 5ea416589343cdb392617f4f221d5ecd9604b914 Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Thu, 1 Jan 2026 16:00:46 -0700 Subject: [PATCH] Add Look In Ruby Version Dotfile as a Mise TIL --- README.md | 3 ++- mise/look-in-ruby-version-dotfile.md | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 mise/look-in-ruby-version-dotfile.md diff --git a/README.md b/README.md index 7159f8c..9bef3d3 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ working across different projects via [VisualMode](https://www.visualmode.dev/). For a steady stream of TILs, [sign up for my newsletter](https://visualmode.kit.com/newsletter). -_1716 TILs and counting..._ +_1717 TILs and counting..._ See some of the other learning resources I work on: @@ -747,6 +747,7 @@ If you've learned something here, support my efforts writing daily TILs by - [Create Umbrella Task For All Test Tasks](mise/create-umbrella-task-for-all-test-tasks.md) - [List The Files Being Loaded By Mise](mise/list-the-files-being-loaded-by-mise.md) +- [Look In Ruby Version Dotfile](mise/look-in-ruby-version-dotfile.md) - [Preserve Color Output For Task Command](mise/preserve-color-output-for-task-command.md) - [Read Existing Dot Env File Into Env Vars](mise/read-existing-dot-env-file-into-env-vars.md) - [Run A Command With Specific Tool Version](mise/run-a-command-with-specific-tool-version.md) diff --git a/mise/look-in-ruby-version-dotfile.md b/mise/look-in-ruby-version-dotfile.md new file mode 100644 index 0000000..702fe53 --- /dev/null +++ b/mise/look-in-ruby-version-dotfile.md @@ -0,0 +1,26 @@ +# Look In Ruby Version Dotfile + +Newer versions of [`mise`](https://mise.jdx.dev/dev-tools/) specifically only +look for tool versions in `mise.toml` as well as the asdf `.tool-versions` file. +A lot of Ruby projects use the `.ruby-version` file to indicate the Ruby version +of a project. To continue to use the `.ruby-version` file instead of migrating +to `mise.toml`, you need to tell `mise` that you prefer to use the idiomatic +version file. + +I added the following line to my +[`~/.config/mise/config.toml`](https://github.com/jbranchaud/dotfiles/commit/8edeb7a9c53500e89e88b4079cbd1859ebebcbda) +file: + +```toml +idiomatic_version_file_enable_tools = ["ruby"] +``` + +Now, whenever `mise` is looking for the specified Ruby version of a project, it +will also look for `.ruby-version`. + +Here is a [full list of idomatic version files supported by +`mise`](https://mise.jdx.dev/configuration.html#idiomatic-version-files). + +See +[`idiomatic_version_file_enable_tools`](https://mise.jdx.dev/configuration/settings.html#idiomatic_version_file_enable_tools) +for more details.