A minimal shell script that changes the current Ruby version by updating environment variables.
chruby is a minimal Ruby version manager that changes the current Ruby version by updating shell environment variables. It solves the problem of managing multiple Ruby installations on a single system without the complexity of larger version managers. The tool focuses exclusively on switching Ruby environments while maintaining correct gem paths and other Ruby-related variables.
Ruby developers who need to switch between different Ruby versions for different projects and prefer a lightweight, focused tool over more complex version managers.
Developers choose chruby for its simplicity, minimal codebase, and focused feature set that avoids unnecessary complexity. It provides reliable Ruby switching without hooking into shell commands or requiring special permissions, making it easier to understand and maintain than alternatives.
Changes the current Ruby
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
With only about 100 lines of code, chruby is easy to audit, understand, and maintain, as highlighted in the README.
It doesn't hook into shell commands like cd or install shims, preventing interference with other tools and simplifying the environment.
Correctly sets $PATH, $GEM_HOME, $GEM_PATH, and other Ruby-specific variables, ensuring gems are installed in user-specific directories like ~/.gem/.
Allows convenient switching between Rubies using partial names, making version selection faster and more intuitive.
chruby does not install Rubies; users must manage installations separately with tools like ruby-install, adding an extra step and complexity to setup.
Only supports bash and zsh, excluding users of other popular shells like fish, which requires relying on unofficial community plugins for compatibility.
For Rubies installed outside default directories, users must manually append paths to the RUBIES variable, which can be cumbersome and error-prone.
chruby is an open-source alternative to the following products:
ry is a fast and modern JavaScript runtime built on the V8 JavaScript engine, designed as a drop-in replacement for Node.js with improved performance.
rbfu is a Ruby version manager similar to rbenv that provides a simple way to install and switch between Ruby versions with minimal setup.
RVM (Ruby Version Manager) is a command-line tool that allows users to install, manage, and work with multiple Ruby environments on a single system.
rbenv is a command-line tool for managing multiple Ruby versions on Unix-like systems, allowing developers to switch between Ruby versions per project.
ruby-version is a simple file format used to specify the Ruby version for a project, commonly used with version managers like RVM or rbenv.