Skip to content

Instantly share code, notes, and snippets.

@lebao3105
Last active May 14, 2023 12:46
Show Gist options
  • Save lebao3105/71019c578e5c281cc8357b1470da78db to your computer and use it in GitHub Desktop.
Save lebao3105/71019c578e5c281cc8357b1470da78db to your computer and use it in GitHub Desktop.

Notes

Tested on Ubuntu 22.04 LTS (WSL), should work on other versions. Uninstall all pre-installed ruby installs first.

  1. Update apt repos first, always
$ sudo apt update
  1. Install needed tools
$ sudo apt install curl libssl-dev zlib1g-dev git gcc g++ default-jre -y
  1. Install rbenv
$ curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash
  1. Init rbenv on startups
$ echo 'eval "$(~/.rbenv/bin/rbenv init - bash)"' >> ~/.bashrc
  1. Restart your terminal
$ rbenv install -l
  1. Install ruby and jruby
$ # Select the latest stable version of ruby and jruby. Then run:
$ rbenv install 'ruby version' --verbose
$ rbenv install 'jruby version' --verbose
  1. Set the default ruby version
$ rbenv global 'ruby version'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment