venerdì 5 novembre 2010

RVM passo passo

Seguendo le istruzioni qui sono riuscito ad avere diversi ambienti ruby coesistenti

Istallazione

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

Operazioni post installazione

2) Check librerie necessarie come da messaggio presentato

# For RVM
rvm: bash curl git

# For JRuby (if you wish to use it) you will need:
jruby: aptitude install curl sun-java6-bin sun-java6-jre sun-java6-jdk

# For Ruby (MRI & ree) you should install the following OS dependencies:
ruby: aptitude install build-essential bison openssl libreadline5 libreadline5-dev curl git zlib1g zlib1g-dev libssl-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev

ruby-head: git subversion autoconf

# For IronRuby (if you wish to use it) you will need:
ironruby: aptitude install curl mono-2.0-devel


3) Modifiche .bashrc

a fine file:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session.

e modificato dove si trovasse la forma '&& return' come da istruzioni modifcanso come
if [...] then ;
code
fi


4) chiusura console

5) prova con
$ type rvm | head -n1
rvm è una funzione


Utilizzo

rvm install 1.9.2
rvm 1.9.2 --default # per rendere definitivo il cambio
rvm info
rvm system --default # per tornare a ruby standard



UPDATE

per alcune librerie può essere che serva una ricompilazione sotto ubuntu per ogni ambiente come riportato qui