LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

chruby

Lightweight Ruby version switcher

TLDR

List available Ruby versions
$ chruby
copy
Switch to specific Ruby
$ chruby ruby-3.2.0
copy
Switch to system Ruby
$ chruby system
copy
Show current Ruby
$ chruby | grep '\*'
copy

SYNOPSIS

chruby [rubyversion_ | system]

DESCRIPTION

chruby switches between multiple Ruby versions by modifying PATH and related environment variables. Lightweight alternative to RVM and rbenv. Just 90 lines of shell script.Works with rubies installed by ruby-install or built from source.

SETUP

Add to ~/.bashrc or ~/.zshrc:

$ source /usr/local/share/chruby/chruby.sh
copy
For auto-switching:
$ source /usr/local/share/chruby/auto.sh
copy

AUTO-SWITCHING

With auto.sh loaded, chruby reads .ruby-version files:

$ echo "ruby-3.2.0" > .ruby-version
copy
Checks current and parent directories automatically.

DEFAULT VERSION

Set in ~/.bashrc or ~/.zshrc:

$ chruby ruby-3.2.0
copy

ENVIRONMENT

RUBIES

Array of Ruby installation paths
RUBY_ROOT
Current Ruby installation path
GEM_HOME / GEM_PATH
Gem directories

INSTALL

brew install chruby
copy
nix profile install nixpkgs#chruby
copy

CAVEATS

Only switches versions - use ruby-install to install rubies. Does not override cd command (uses pre-prompt hook).

SEE ALSO

rbenv(1), rvm(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid