{{tag>Brouillon Ruby Paquet}} # Notes ruby capistrano capshell peut être remplacé par clush (paquet clustershell), pour avoir un shell sur plusieurs serveurs ### Création du paquage Capistrano (utilisable en userland) ### Voir https://rvm.io/integration/capistrano/#gem INSTALL DE RVM Ruby Version Manager -> Voir https://rvm.io/ Prerequis ~~~bash yum install libxslt-devel curl git patch gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison iconv-devel yum install ruby-libs # (a verifier !) ~~~ -Install ~~~bash curl -L https://get.rvm.io | bash -s stable --ruby ~~~ INSTALL DE CAPISTRANO ~~~bash ~/.rvm/rubies/*/bin/gem install --user rvm-capistrano ~~~ SCRIPT DE LANCEMENT `~/bin/cap` ~~~bash #! /bin/bash CAP=$(echo /home/eib/.gem/ruby/*/bin/cap | tail -1) RUBY=$(echo /home/eib/.rvm/rubies/ruby-*/bin/ruby | tail -1) $RUBY $CAP $* ~~~ ~~~bash chmod +x ~/bin/cap ~~~ TEST DE CAPISTRANO ~~~bash ~/bin/cap shell ~~~ CONSCRUCTION DU PAQUET ~~~bash find /home/eib/.gem /home/eib/.rvm/rubies/ruby-* /home/eib/.rvm/gems/ruby-* /home/eib/.rvm/environments /home/eib/.rvm/bin /home/eib/bin/cap -depth | cpio -ov --format=ustar | gzip >captistrano.tar.gz ~~~ NB : les répertoires nécessaires au paquet peuvent être trouvé à l'aide de "strace". Voir NOTES. DEINSTALL ~~~bash rm -rf ~/.rvm ~/.gem ~/bin/cap ~~~ NOTES http://henriksjokvist.net/archive/2012/2/deploying-with-rbenv-and-capistrano/ Commande utile : Pour relancer la compilation de ruby : ~~~bash rvm reinstall all --force ~~~ Pour trouver les repertoires nécessaires à la création du paquet ~~~bash /bin/ls -ld $(strace -f -e trace=file cap 2>&1 | grep -v 'No such file or directory' | grep open | cut -d'"' -f2 | grep '/home/eib/.rvm/') | grep ^d|awk '{print $9}' ~~~ ~~~bash ~/.rvm/bin/gem-ruby-2.0.0-p0 update ~~~