Skip to content

Instantly share code, notes, and snippets.

@hileon
Forked from fajrif/rvm_cheatsheet
Created March 27, 2012 04:12
Show Gist options
  • Select an option

  • Save hileon/2212471 to your computer and use it in GitHub Desktop.

Select an option

Save hileon/2212471 to your computer and use it in GitHub Desktop.

Revisions

  1. @fajrif fajrif revised this gist Oct 18, 2011. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion rvm_cheatsheet
    Original file line number Diff line number Diff line change
    @@ -39,10 +39,12 @@ If this fails with compiler errors, you may need to install some packages.
    rvm pkg install zlib
    rvm pkg install readline
    rvm pkg install iconv
    rvm pkg install libxml2
    rvm install 1.9.2 --with-openssl-dir=$rvm_path/usr \
    --with-zlib-dir=$rvm_path/usr \
    --with-readline-dir=$rvm_path/usr \
    --with-iconv-dir=$rvm_path/usr
    --with-iconv-dir=$rvm_path/usr \
    --with-libxml2-dir=$rvm_path/usr

    On Mac, you may need to install some libraries via MacPorts.

  2. @fajrif fajrif revised this gist Oct 17, 2011. 1 changed file with 8 additions and 6 deletions.
    14 changes: 8 additions & 6 deletions rvm_cheatsheet
    Original file line number Diff line number Diff line change
    @@ -35,12 +35,14 @@ Install a given version of ruby

    If this fails with compiler errors, you may need to install some packages.

    rvm package install openssl
    rvm package install readline
    rvm package install iconv
    rvm install 1.9.2 --with-openssl-dir=$HOME/.rvm/usr \
    --with-readline-dir=$HOME/.rvm/usr \
    --with-iconv-dir=$HOME/.rvm/usr
    rvm pkg install openssl
    rvm pkg install zlib
    rvm pkg install readline
    rvm pkg install iconv
    rvm install 1.9.2 --with-openssl-dir=$rvm_path/usr \
    --with-zlib-dir=$rvm_path/usr \
    --with-readline-dir=$rvm_path/usr \
    --with-iconv-dir=$rvm_path/usr

    On Mac, you may need to install some libraries via MacPorts.

  3. @fajrif fajrif revised this gist Oct 17, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion rvm_cheatsheet
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@ Install RVM

    See http://rvm.beginrescueend.com/rvm/install/

    bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
    bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)

    Install rvm for all users
    --------------------------
  4. Fajri Fachriansyah revised this gist Jun 14, 2011. 1 changed file with 35 additions and 1 deletion.
    36 changes: 35 additions & 1 deletion rvm_cheatsheet
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,37 @@
    RVM home page: http://rvm.beginrescueend.com

    Install RVM
    ------------

    See http://rvm.beginrescueend.com/rvm/install/

    bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )

    Install rvm for all users
    --------------------------

    Fairly complicated; make sure to read
    http://rvm.beginrescueend.com/deployment/system-wide/

    Upgrade to the latest version of rvm from github
    -------------------------------------------------

    rvm update --head

    Ruby on Rails 3 Tutorial says to follow this with

    rvm reload
    rvm install 1.8.7
    rvm install 1.9.2

    and, if you need a patchlevel, do something like

    rvm install 1.8.7-p174

    Install a given version of ruby
    --------------------------------

    rvm install 1.9.2

    If this fails with compiler errors, you may need to install some packages.

    @@ -100,4 +134,4 @@ Lots more help
    ---------------

    rvm help
    http://rvm.beginrescueend.com/
    http://rvm.beginrescueend.com/
  5. Fajri Fachriansyah created this gist Jun 14, 2011.
    103 changes: 103 additions & 0 deletions rvm_cheatsheet
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,103 @@

    If this fails with compiler errors, you may need to install some packages.

    rvm package install openssl
    rvm package install readline
    rvm package install iconv
    rvm install 1.9.2 --with-openssl-dir=$HOME/.rvm/usr \
    --with-readline-dir=$HOME/.rvm/usr \
    --with-iconv-dir=$HOME/.rvm/usr

    On Mac, you may need to install some libraries via MacPorts.

    sudo port install ncurses
    sudo port install libyaml
    sudo port install zlib
    rvm install 1.9.2 --with-libyaml-dir=/opt/local \
    --with-openssl-dir=$HOME/.rvm/usr \
    --with-readline-dir=$HOME/.rvm/usr \
    --with-iconv-dir=$HOME/.rvm/usr

    More at http://rvm.beginrescueend.com/rubies/installing/

    Open a new shell and rvm!
    -------------------------

    rvm use 1.9.1
    >> Switching to ruby 1.9.1 ...

    ruby -v
    >> ruby 1.9.1p243 (2009-07-16 revision 24175) [x86_64-linux]

    which ruby
    >> /home/wayne/.rvm/ruby-1.9.1-p243/bin/ruby

    Make 1.9.2 default for all new shells
    --------------------------------------

    rvm --default 1.9.2

    Reverting to system default
    ----------------------------

    rvm system
    ruby -v
    >> ruby 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0]
    which ruby
    >> /usr/bin/ruby

    Installing gems in multiple ruby versions
    ------------------------------------------

    rvm 1.8.6,1.9.1 gem install rspec json --no-rdoc --no-ri

    Starting a new project? Create a Gemset and rvmrc at the same time:
    -------------------------------------------------------------------
    rvm --create --rvmrc ree@project_name

    Working with gemsets
    --------------------

    rvm 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

    The global gemset
    -----------------

    With every ruby, rvm creates the global gemset. Gems installed into this
    gemset are available to all gemsets in the ruby.

    rvm 1.8.7
    rvm gemset create project_name
    gem list # no gems :(

    rvm gemset use global
    gem install rake
    rvm gemset use project_name
    gem list # rake :)

    Install a gem directly into the global gemset:

    rvm 1.8.7@global gem install shoulda

    Install cheat in the global gemset when you install a new ruby:

    echo "cheat" >> ~/.rvm/gemsets/global.gems

    .rvmrc
    ------

    rvm can automatically use a ruby and gemset when you cd to a project
    directory.

    echo "rvm 1.8.7@project_name" > ~/projects/project_name/.rvmrc

    Lots more help
    ---------------

    rvm help
    http://rvm.beginrescueend.com/