Ruby versions
Butler manages Ruby versions through rv.
Versions are prebuilt downloads, so installing a Ruby takes seconds rather than
the several minutes a source build costs.
Install Ruby
Section titled “Install Ruby”Ruby support comes from the rv component:
butler install rvbutler rv ruby install 3.4butler rv ruby install 3.3List what’s installed, or ask which Ruby applies where you are:
butler rv ruby listbutler rv ruby findThe Ruby tab in the menu bar app offers the
same actions, and appears once rv is installed.
Run ruby, bundle and gem
Section titled “Run ruby, bundle and gem”After shell integration, ruby,
bundle, bundler, gem, rake and irb are on your PATH and resolve the
version for the directory you’re in — a project’s .ruby-version, else your
default:
ruby -vbundle installbundle exec rspecOr reach rv directly:
butler rv run ruby -vbundle exec works outside your terminal
Section titled “bundle exec works outside your terminal”If you run Fastlane, RuboCop or RSpec from anything other than an interactive shell, this is the point of the whole feature.
A version manager’s shell hook only runs in an interactive shell. Your editor,
a build script, a git hook and CI all inherit PATH and nothing else — so they
get the system Ruby, and bundle exec fails with a version or gem mismatch
that looks nothing like a version-manager problem.
Butler installs real files on PATH, so those callers resolve exactly what
your terminal does, with no profile to source first.
Put Butler’s toolchain on your PATH
Section titled “Put Butler’s toolchain on your PATH”butler shell installOpen a new terminal, then confirm what’s resolving:
butler doctorDoctor names the Ruby each shim resolves to, flags anything earlier on PATH
shadowing Butler’s, and warns when the same version exists in two places —
which matters more than it sounds, because gems live beside the interpreter. Two
copies of Ruby 3.4 means two different gem sets, and which one you get can
differ between your terminal and your build.
Where the versions live
Section titled “Where the versions live”Butler installs Rubies to ~/.local/share/butler/runtimes/rv.
That’s outside Butler’s usual state directory for one specific reason: Bundler
writes the Ruby’s library path into RUBYOPT, and Ruby splits that variable on
whitespace with no way to quote or escape a path. Butler’s normal home is inside
Application Support — the space breaks every bundle exec — so Rubies get a
space-free path of their own.
RUBIES_PATH is a search list, so if you already used rv, the Rubies you had
stay where they are and keep working. Butler adds its directory rather than
taking anything over.