ruby-install v1.1.2
ruby-install
Installs Ruby, JRuby, TruffleRuby (native / GraalVM), or mruby.
Features
- Supports installing arbitrary versions.
- Supports downloading the latest versions and checksums from ruby-versions.
- Supports installing into
/opt/rubies/for root and~/.rubies/for users by default. - Supports installing into arbitrary directories.
- Supports downloading from arbitrary URLs.
- Supports downloading from mirrors.
- Supports downloading/applying patches.
- Supports specifying arbitrary
./configureoptions. - Supports downloading archives using
wgetorcurl. - Supports verifying downloaded archives via MD5, SHA1, SHA256 or SHA512 checksums.
- Supports installing build dependencies via the package manager:
- Has tests.
Anti-Features
- Does not require updating every time a new Ruby version comes out.
- Does not require recipes for each individual Ruby version or configuration.
- Does not support installing trunk/HEAD or nightly rolling releases.
- Does not support installing unsupported/unmaintained versions of Ruby.
Requirements
- bash >= 3.x
grep- wget > 1.12 or curl
md5sumormd5sha1sumorsha1sha256sumorsha256sha512sumorsha512tarbzip2xzpatch(if--patchis specified)- gcc >= 4.2 or clang
Synopsis
List supported Rubies and their current stable versions:
$ ruby-installUpdates then list the supported Rubies and their current stable versions:
$ ruby-install --updateInstall the current stable version of Ruby:
$ ruby-install rubyInstall the latest version of Ruby:
$ ruby-install --update rubyInstall a stable version of Ruby:
$ ruby-install ruby 3.1Install a specific version of Ruby:
$ ruby-install ruby 3.1.2Install a Ruby into a specific directory:
$ ruby-install --install-dir /path/to/dir rubyInstall a Ruby into a specific rubies directory:
$ ruby-install --rubies-dir /path/to/rubies/ rubyInstall a Ruby into /usr/local:
$ ruby-install --system ruby 3.1.2Install a Ruby from an official site with directly download:
$ ruby-install -M https://ftp.ruby-lang.org/pub/ruby ruby 3.1.2Install a Ruby from a mirror:
$ ruby-install -M http://www.mirrorservice.org/sites/ftp.ruby-lang.org/pub/ruby ruby 3.1.2Install a Ruby with a specific patch:
$ ruby-install -p https://raw.github.com/gist/4136373/falcon-gc.diff ruby 1.9.3-p551Install a Ruby with a specific C compiler:
$ ruby-install ruby 3.1.2 -- CC=clangInstall a Ruby with specific configuration:
$ ruby-install ruby 3.1.2 -- --enable-shared --enable-dtrace CFLAGS="-O3"Install a Ruby without installing dependencies first:
$ ruby-install --no-install-deps ruby 3.1.2Uninstall a Ruby version:
$ rm -rf ~/.rubies/ruby-3.1.2Integration
Using ruby-install with RVM:
$ ruby-install --rubies-dir ~/.rvm/rubies ruby-3.2.0-preview3Using ruby-install with rbenv:
$ ruby-install --install-dir ~/.rbenv/versions/3.2.0-preview3 ruby-3.2.0-preview3ruby-install can even be used with Chef.
Install
wget https://github.com/postmodern/ruby-install/releases/download/v0.9.3/ruby-install-0.9.3.tar.gz
tar -xzvf ruby-install-0.9.3.tar.gz
cd ruby-install-0.9.3/
sudo make installPGP
All releases are PGP signed for security. Instructions on how to import my PGP key can be found on my blog. To verify that a release was not tampered with:
wget https://github.com/postmodern/ruby-install/releases/download/v0.9.3/ruby-install-0.9.3.tar.gz.asc
gpg --verify ruby-install-0.9.3.tar.gz.asc ruby-install-0.9.3.tar.gzHomebrew
ruby-install can also be installed with homebrew:
brew install ruby-installOr the absolute latest ruby-install can be installed from source:
brew install ruby-install --HEADArch Linux
ruby-install is already included in the AUR:
yaourt -S ruby-installFedora Linux
ruby-install is available on Fedora Copr.
FreeBSD
ruby-install is included in the official FreeBSD ports collection:
cd /usr/ports/devel/ruby-install/ && make install cleanKnown Issues
Please see the wiki.
Alternatives
Endorsements
I like the approach you're taking. Curious to see how it plays out.
-- Sam Stephenson of rbenv