Cheatography
https://cheatography.com
RVM cheat sheet from errtheblog.com (only brought over the linux information)
RVM Cheat Sheet Info
Originally Posted: |
|
RVM Homepage: |
|
Install curl and RVM
If it is not installed already, install curl .
To check if it is installed, run the command which curl . If there is not output, run the following command:
apt-get install curl
curl -L get.rvm.io | bash -s stable
close and reopen your terminal window after running this command. To make sure it installed and is available, type which rvm or rvm --verion ; but only after reopening your terminal window. |
Install Ruby
rvm install 1.9.3
|
Latest known patch level |
rvm install 1.9.3 -j #
|
Parallel compile, replace # with number of CPU cores |
rvm install 1.9.3 --patch falcon
|
Use a patch (falcon for performance) |
rvm install 1.9.2-p318
|
Patch level 318 |
rvm install rbx --1.9
|
Rubinius with 1.9 mode set as default |
Update RVM
In case of problems try first with development version
(maybe it's already fixed):
rvm get head
Very old installations might not support those update methods, just run the installer and reopen your terminal.
Install Ruby Dependencies
Follow the instructions from running: rvm requirements |
List All Rubies and Gemsets
ruby list
|
List rubies only |
rvm list gemsets
|
List rubies and gemsets |
rvm gemset list
|
List gemsets for current ruby |
More Help is Available
in your terminal: rvm help |
|
|
So you got through it all....and it won't work!
Error |
Poosible Fix |
Worked from |
error: says rvm use ... won't work |
in your terminal, type /bin/bash --login |
LXTerminal |
These are things you can do to try and solve your issue
|
|
Selecting Ruby for Work
rvm system
|
For system ruby with fallback to default |
rvm use jruby
|
For current session only |
rvm use --default 1.9.3
|
For current and new sessions |
rvm use --ruby-version rbx
|
For current session and this project |
Using ruby and gems
After selecting Ruby work as usual:
ruby -v
gem install haml
haml |
Temporarily selecting another Ruby or gemset
rvm 1.8.7 do gem install rspec
|
in the given ruby |
rvm 1.8.7,1.9.2 do gem install haml
|
in these two rubies |
rvm @global do gem install gist
|
in @global gemset of current ruby |
Gemsets
RVM by default allows creating multiple environments for one ruby - called gemsets.
Gemsets can be specified together with ruby name using gemsets separator(@):
- ruby-1.9.3-p125@my-project
During installation of Ruby, RVM creates two gemsets:
- default - automatically selected when no @gemset specified: rvm use 1.9.3
- global - super gemset, inherited by all other gemsets for the given ruby |
Working with gemsets
rvm use 1.8.7
|
use the ruby to manage gemsets for |
rvm gemset create project_name
|
create a gemset |
rvm gemset use project_name
|
use a gemset in this ruby |
rvm gemset list
|
list gemsets in this ruby |
rvm gemset delete project_name
|
delete a gemset |
rvm 1.9.1@other_project_name
|
use another ruby and gemset |
rvm 1.9.3@_project --create --rvmrc
|
use and create gemset & .rvmrc |
|
Created By
Metadata
Favourited By
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets
More Cheat Sheets by DeeJRoth