Visualizzazione post con etichetta rvm. Mostra tutti i post
Visualizzazione post con etichetta rvm. Mostra tutti i post

mercoledì 6 aprile 2011

How to remove all Rubygems inside a RVM gemset

The only way to uninstall all the gems inside a RVM gemset is to use the following command:
$ rvm use 1.9.2@my-gemset
Using /home/user/.rvm/gems/ruby-1.9.2-p180 with gemset my-gemset
$ gem uninstall gem1 gem2 gem3 ...
A bit boring, don't you think? A way to automate this process is through the following command:
gem uninstall `gem list | cut -d" " -f1 | tr '\n' ' '`
If you don't use RVM to manage different Ruby versions, maybe you have to change the command above in something like this:
sudo gem uninstall `sudo gem list | cut -d" " -f1 | tr '\n' ' '`
Pay attention to copy all the "`" characters.
In this way you can uninstall all the gems only with one command.
Hope this helps :-)

giovedì 28 ottobre 2010

Install Ruby Version Manager (RVM) on Ubuntu Lucid/Maverick

RVM is a command line tool which allows us to easily install, manage and work with multiple ruby environments from interpreters to sets of gems. In order to install RVM you need a few packages:
sudo apt-get install build-essential curl zlib1g-dev
libreadline5-dev libssl-dev libxml2-dev
Now you need to install a temporary version of ruby and rubygems. This version will be used to install the rvm gem.
sudo apt-get install ruby1.8 rubygems1.8
After the installation is completed you can install the rvm gem with the command:
sudo gem install rvm
To complete the installation now run:
/var/lib/gems/1.8/bin/rvm-install
As the last step you have to add the following line to the file .bashrc in your home. So edit it with your favourite editor or create it if it doesn't exist.
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"  # This loads RVM into a shell session.
To verify the installation, type rvm -v and the output should be the following:
$ rvm -v
rvm 1.0.15 by Wayne E. Seguin (wayneeseguin@gmail.com) [http://rvm.beginrescueend.com/]
Now to install ruby inside rvm use the simple command:
$ rvm install 1.9.2
"1.9.2" is the version of the ruby interpreter that you want to install. RVM automatically downloads the sources from the internet, compiles and install them. To set 1.9.2 as the default version use the command:
rvm --default 1.9.2
Enjoy with ruby!

lunedì 18 ottobre 2010

L'aggiornamento di rvm fallisce?

RVM è un tool a linea di comando che permette di installare, gestire e lavorare con più versioni di ruby in ambienti separati sia per l'interprete che per le gem. Durante l'aggiornamento di rvm può capitare che appaiano i seguenti messaggi di errore:
$ rvm update
rvm 1.0.1 by Wayne E. Seguin (wayneeseguin@gmail.com) [http://rvm.beginrescueend.com/]
info: fetching rvm-1.0.14.tar.gz
info: Extracting rvm-1.0.14.tar.gz ...
error: Error running 'gunzip "/home/davide/.rvm/archives/rvm-1.0.14.tar.gz" | tar xf - -C /home/davide/.rvm/src', please check /home/davide/.rvm/log/extract*.log
info: Installing rvm-1.0.14...
error: Error running 'builtin cd /home/davide/.rvm/src/rvm-1.0.14/ ; ./install', please check /home/davide/.rvm/log/install*.log
Il problema si risolve facilmente aggiungendo il parametro "--head" al precedente comando:
rvm update --head
dopodichè l'aggiornamento procederà regolarmente. Al termine della procedura di installazione è necessario dare il comando:
$ rvm reload
per utilizzare la versione di rvm appena installata.
Info su rvm: http://rvm.beginrescueend.com