Skip to content

magynhard/rvm-windows

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rvm-windows

npm package downloads License: MIT

Reimplementation of most important rvm.io features for MS Windows

As there is no rvm.io available for native windows, but only for POSIX by Cygwin, this is a reimplementation of basic rvm.io features for native MS Windows on the classic command line. It is based on the packages shipped by rubyinstaller.org.

RVM 4 Windows allows you to comfortably install and manage several versions of Ruby on your Windows machine.

It automatically detects .ruby-version files or ruby version definitions in Gemfiles and runs your project on the classic windows command line on the specified ruby version automatically.

Beneath you can switch your ruby version instantly.

Ruby environment configuration are managed by RVM per user in C:\Users\%USERNAME%\.rvm but stored for all users in C:\ProgramData\rvm by default.

- Release candidate 0.9.9! Test and share feedback! Thank you!

The goal of this project is not to 100% reimplement all features of rvm.io, but the most important and common ones by preserving most of the same command line interface. Some special Windows related stuff is added as well.

Table of contents

Features & Limitations

  • Support automatic installation only for rubies from rubyinstaller starting from 2.4.x and x64 architecture. But you may add older installed rubies manually by using the rvm add <path> command.
  • Windows 10 or later
  • Classic command line and Powershell
  • Automatic recognition of .ruby-version files with autoswitch
  • Experimental rvm kit command with recipes for several ruby versions to install common used native gems.
  • When setting a proxy, the HTTP_PROXY and HTTPS_PROXY env will be temporary set, when running any rvm oder ruby command

Commands

The following commands are available in rvm-windows:

add <path>                 # Add a installed ruby environment to the list (alias: mount)
automount                  # Scan for ruby installations and add them to the RVM configuration (alias: scan)
config                     # Print current RVM config
config default             # Print default version
config default <version>   # Set default version
config proxy               # Get the configured proxy host.
config proxy <host>        # Set the proxy server host. E.g. http://proxy:12345
config proxy delete        # Remove the proxy server host from the configuration.
current                    # Print current ruby environment version
default                    # Use default ruby version (alias: rvm use default)
delete <version>           # Delete given ruby environment (alias: remove)
fix                        # Automatically fix paths and versions in RVM configuration
get                        # Upgrade RVM to its latest release version
help                       # Print this usage guide
info                       # Show the environment information for current ruby
init                       # Initialize RVM by adding it to the PATH environment variable
install <version>          # Install a specific ruby version
kick <version>             # Only remove given ruby environment from the RVM list without deleting any ruby environment.
kit                        # Experimental: Install a bunch of widely used x64 dependencies automatically to the current ruby environment, which are needed to build native gems like postgresql, mysql2, ... 
list                       # List all installed ruby versions managed by RVM
list verbose               # List all installed ruby versions managed by RVM with additional info
list known                 # List all installable ruby versions with latest patch version
list all                   # List all installable ruby versions
mount <path>               # Add a installed ruby environment to the list (alias: add <path>)
reinstall <version>        # Delete given ruby environment and install it again.
remove <version>           # Delete given ruby environment (alias: uninstall)
scan                       # Scan for ruby installations and add them to the RVM configuration (alias: automount)
system                     # Use the system ruby (alias: rvm use system)
uninstall <version>        # Delete given ruby environment (alias: remove)
upgrade <version>          # Upgrade given version to its latest patch version
upgrade <from> <to>        # Upgrade given from_version to given to_version
use <version>              # Switch to specified ruby version
version                    # Display RVM build version

Usage

Usage examples

List installed rubies

rvm list
 * ruby-3.2.2
   ruby-2.4.10
=> ruby-2.7.8

# => - current # =* - current && default # * - default

List installable rubies

rvm list known
 - ruby-3.3.0
 - ruby-3.2.3
 - ruby-3.2.2
 - ruby-3.2.1
 - ruby-3.2.0
 - ruby-3.1.4
...
 - ruby-3.0.2
 - ruby-3.0.1
 - ruby-3.0.0
 - ruby-2.7.8
 - ruby-2.7.7
 - ruby-2.7.6
 - ruby-2.7.5
...
 - ruby-2.5.1
 - ruby-2.4.10
 - ruby-2.4.9
...
 - ruby-2.4.4
 - ruby-2.4.4

Switch version

You do not need to prefix ruby-

rvm use 2.4.10
Using ruby-2.4.10 ...

You even do not need to specify the exact version, it will automatically use or install the highest one available!

rvm use 2
Using ruby-2.7.8 ...

Install new version

rvm install 3.2
Installing ruby-3.2.3 ...

...

Installation

Requirements

rvm-windows requires

  • Windows >= 10.x
  • NodeJS >= 18.x

Setup

You can either use npm or yarn to install rvm-windows.

Ensure that NodeJS >= 18.x is already installed.

Then on your command line execute the following command:

yarn

yarn global add rvm-windows

npm

npm install -g rvm-windows

After installing the command rvm is available on the command line.

Troubleshooting

Does not run the selected ruby

Check if in your system wide PATH setting some ruby environment is listed and remove it from the system PATH variable.

Otherwise try

rvm init

or

rvm fix

again.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/magynhard/rvm-windows. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

About

Clone of RVM.io for MS Windows

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published