parm530
8/16/2017 - 12:59 PM

RVM

RVM

Installing RVM (also allows you to install homebrew once you install a ruby version)

\curl -sSL https://get.rvm.io | bash -s stable

* To start using RVM you need to run:
source /Users/kishansahadeo/.rvm/scripts/rvm

* Installing RVM to /Users/parmsahadeo/.rvm/
  * Adding rvm PATH line to /Users/parmsahadeo/.profile /Users/parmsahadeo/.mkshrc /Users/parmsahadeo/.bashrc /Users/parmsahadeo/.zshrc.
  * Adding rvm loading line to /Users/parmsahadeo/.profile /Users/parmsahadeo/.bash_profile /Users/parmsahadeo/.zlogin.

List all Rubies

  • rvm list all rubies
rvm list rubies

Creates a ruby version

  • rvm install version
  • Once you install a ruby, homebrew will be installed
rvm install 2.3.1

Create a ruby with name

  • rvm install 2.3.1-name
rvm install 2.3.1-production

Switch between ruby versions

  • rvm use name
rvm use 2.3.1-test

To create a gemset

  • rvm gemset create name_of_set
rvm gemset create engines2016

To use a certain gemset

  • rvm gemset use name_of_gemset
rvm gemset use engines2016

or as an alternative:
rvm ruby-version@gemset-name
rvm 2.3.1@rails425

Install Rails version

gem install rails -v 4.2.5 -N

Issues

rvm env > .powenv

To Remove RVM

  • rvm implode
Note you may need to manually remove /etc/rvmrc and ~/.rvmrc if they exist still.
Please check all .bashrc .bash_profile .profile and .zshrc for RVM source lines and delete or comment out if this was a Per-User installation.
Also make sure to remove `rvm` group if this was a system installation.
Finally it might help to relogin / restart if you want to have fresh environment (like for installing RVM again).
  • Remove the following:
  • rm /etc/rvmrc
  • rm ~/.rvmrc
  • Check .bashrc
  • Check .bash_profile
  • Check .profile
  • Check .mkshrc
  • Check .zshrc to remove all references to rvm

Re-Install RVM

  • install key first!
  • gpg --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
  • \curl -sSL https://get.rvm.io | bash -s stable --ruby --auto-dotfiles
Upgrading the RVM installation in /Users/kishansahadeo/.rvm/
    Removing rvm PATH line from /Users/kishansahadeo/.mkshrc.
    Adding rvm PATH line to /Users/kishansahadeo/.profile /Users/kishansahadeo/.mkshrc /Users/kishansahadeo/.bashrc /Users/kishansahadeo/.zshrc.
    Removing rvm loading line from /Users/kishansahadeo/.profile /Users/kishansahadeo/.bash_profile /Users/kishansahadeo/.zlogin.
    Adding rvm loading line to /Users/kishansahadeo/.profile /Users/kishansahadeo/.bash_profile /Users/kishansahadeo/.zlogin.
Upgrade of RVM in /Users/kishansahadeo/.rvm/ is complete.
  • If you still get warnings abou path not being set up, make sure that:
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

is located last, on the .bashrc and comment it in other files (.profile)