A simple Ruby version manager written in Ruby. This tool helps you manage multiple Ruby versions by allowing you to install, uninstall, switch, and upgrade Ruby versions. It also ensures system dependencies are resolved automatically.
- Install specific Ruby versions from the official Ruby source.
- Switch between installed Ruby versions.
- Uninstall unwanted Ruby versions.
- Upgrade to the latest available Ruby version.
.ruby-version
file support for project-level Ruby management.- Automatic resolution of system dependencies.
- Logging of operations for debugging purposes.
- Shims for Ruby executables to ensure proper isolation.
-
Clone the repository or download the
ruby_manager.rb
script:git clone https://github.com/yourusername/ruby_manager cd ruby_manager
-
Make the script executable:
chmod +x ruby_manager.rb
-
Ensure Ruby is installed on your system.
-
Install system dependencies (if not already installed):
# On Debian/Ubuntu sudo apt-get update sudo apt-get install -y build-essential libssl-dev libreadline-dev zlib1g-dev libsqlite3-dev # On macOS xcode-select --install brew install openssl readline zlib sqlite3
Run the script using the following commands:
./ruby_manager.rb --install <version>
Example:
./ruby_manager.rb --install 3.2.0
./ruby_manager.rb --list
./ruby_manager.rb --switch <version>
Example:
./ruby_manager.rb --switch 3.2.0
./ruby_manager.rb --uninstall <version>
Example:
./ruby_manager.rb --uninstall 3.1.0
./ruby_manager.rb --upgrade
./ruby_manager.rb --update-manager
Automatically switch to the Ruby version specified in the .ruby-version
file:
./ruby_manager.rb --switch-to-version-file
The Ruby Manager uses a configuration file located at ~/.myruby/config.yml
. By default, it uses:
~/.myruby/versions
for Ruby installations.~/.myruby/shims
for executable shims.
You can edit the config.yml
file to customize these paths.
Operations are logged in ~/.myruby/logs/manager.log
. Check this file for debugging information.
Ensure all required dependencies are installed. Run:
sudo apt-get install -y build-essential libssl-dev libreadline-dev zlib1g-dev
Rebuild all installed gems with:
gem pristine --all
This project is licensed under the MIT License. See the LICENSE
file for details.