Skip to content

Instantly share code, notes, and snippets.

@ThePredators
Last active July 21, 2023 14:20
Show Gist options
  • Save ThePredators/63548e82749418aa805885c1ec87b97f to your computer and use it in GitHub Desktop.
Save ThePredators/63548e82749418aa805885c1ec87b97f to your computer and use it in GitHub Desktop.
[macOS] Ruby Install

🔥 Ruby Version Manager (CheatSheet)

  • ✅ Run the following script on your mac :
# without proxy
curl -L https://get.rvm.io | bash -s stable

# Install rvm
https_proxy=$PROXY http_proxy=$PROXY curl -L https://get.rvm.io | bash -s stable
  • ✅ Open .zshrc and copy this at the end of the file :
source /Users/$(whoami)/.rvm/scripts/rvm

⚠️⚠️⚠️ Do not forget to open a new window of whatever terminal ure using !!! ⚠️⚠️⚠️

  • ✅ Run this commands
VERSION=2.6.5

# Install Ruby (https://www.ruby-lang.org/en/downloads/)
rvm install ruby-$VERSION

# use a ruby version
rvm use ruby-$VERSION

# default ruby version
rvm --default use $VERSION
  • ✅ Check now the ruby version
ruby -v

(Output need to be : ruby 2.6.5 ...)

💥 RBENV :

Globally :

  1. Install and configure rbenv
brew install rbenv

then add this 2 line to .zshrc or .bashrc

export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
  1. Install ruby version 2.7.4
rbenv install 2.7.4
  1. Set Global ruby version
rbenv global 2.7.4
  1. Install latest version of bundler
gem install bundler:2.2.19 -n /usr/local/bin

Under you project :

Set local ruby version

rbenv local 2.7.4

If you need to run bundle install you need to run instead this :

bundle install --path vendor/bundle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment