Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
devweb:webapp:jobsworth [17-06-2013 15:35] edmc73 [Installation] |
devweb:webapp:jobsworth [18-11-2015 10:02] (Version actuelle) edmc73 [Finalement...] |
||
---|---|---|---|
Ligne 8: | Ligne 8: | ||
La doc officiel commence a dater et les commandes sont souvent dépréciées voir obsolètes et je n'ai pas l' | La doc officiel commence a dater et les commandes sont souvent dépréciées voir obsolètes et je n'ai pas l' | ||
- | Ne connaissant pas bien la commande **git**, je télécharge à l' | ||
- | wget https:// | ||
- | On se place dans le répertoire racine | + | <note important> |
- | rvm 1.9.3 do bundle | + | Normalement, |
+ | |||
+ | |||
+ | |||
+ | |||
+ | Installation de rvm (c'est assez long...) | ||
+ | curl -L https:// | ||
+ | source / | ||
+ | rvm all do gem install | ||
+ | rvm reload | ||
+ | |||
+ | Installation de **Passenger** | ||
+ | rvm all do gem install passenger | ||
+ | rvm all do passenger-install-apache2-module | ||
| | ||
- | Assurez vous d' | + | Noté bien les messages suivant afin de configurer Apache. |
- | rvm remove | + | < |
- | rvm install | + | |
- | rvm --default use 1.9.3 | + | Please edit your Apache configuration file, and add these lines: |
+ | |||
+ | | ||
+ | | ||
+ | PassengerDefaultRuby /usr/local/rvm/ | ||
+ | |||
+ | After you restart Apache, you are ready to deploy any number of Ruby on Rails | ||
+ | applications on Apache, without any further Ruby on Rails-specific | ||
+ | configuration!</ | ||
+ | Ici nous allons modifier le fichier adéquate | ||
+ | vi / | ||
+ | et ajouter | ||
+ | LoadModule passenger_module /usr/local/rvm/gems/ruby-1.9.3-p429/ | ||
+ | PassengerRoot /usr/local/rvm/gems/ruby-1.9.3-p429/ | ||
+ | | ||
+ | |||
+ | Si nécessaire, | ||
+ | a2dismod passenger | ||
+ | |||
+ | < | ||
+ | |||
+ | Suppose you have a Rails application in /somewhere. Add a virtual host to your | ||
+ | Apache configuration file and set its DocumentRoot to / | ||
+ | |||
+ | < | ||
+ | ServerName www.yourhost.com | ||
+ | # !!! Be sure to point DocumentRoot to ' | ||
+ | DocumentRoot / | ||
+ | < | ||
+ | # This relaxes Apache security settings. | ||
+ | | ||
+ | # MultiViews must be turned off. | ||
+ | | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | And that's it! You may also want to check the Users Guide for security and | ||
+ | optimization tips, troubleshooting and other useful information: | ||
+ | |||
+ | / | ||
+ | </ | ||
+ | |||
+ | On télécharge via git | ||
+ | cd /var/www | ||
+ | git clone git:// | ||
+ | cd jobsworth | ||
+ | git checkout v3.1 | ||
+ | |||
+ | On configure l' | ||
+ | cp config/ | ||
+ | vi config/ | ||
+ | |||
+ | On se place dans le répertoire racine de ce que l'on vient de télécharger puis on tape la commande suivante : | ||
+ | rvm all do bundle install --without=test development sqlite postgres | ||
| | ||
Ensuite on crée sa base de données mysql | Ensuite on crée sa base de données mysql | ||
CREATE DATABASE jobsworth DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; | CREATE DATABASE jobsworth DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; | ||
GRANT ALL ON jobsworth.* TO ' | GRANT ALL ON jobsworth.* TO ' | ||
- | | ||
- | On crée un fichier de config de la base de données en copiant l' | ||
- | cp config/ | ||
- | et on adapte le contenu. | ||
On s' | On s' | ||
bundle exec lib/ | bundle exec lib/ | ||
| | ||
- | On répond aux questions. On répond **y** la 1ere fois à la question | + | On répond aux questions |
+ | |||
+ | On lance ensuite la mise a jour. | ||
+ | ./ | ||
+ | |||
+ | |||
+ | Et au cas ou | ||
+ | chown -R www-data.www-data / | ||
+ | service apache2 restart | ||
+ | |||
+ | ===== état des lieux ===== | ||
+ | |||
+ | < | ||
+ | ruby 1.9.3p429 (2013-05-15 revision 40747) [x86_64-linux] | ||
+ | |||
+ | [root]# rails -v | ||
+ | Rails 3.2.13 | ||
+ | |||
+ | [root]# rvm -v | ||
+ | rvm 1.20.13 (stable) by Wayne E. Seguin < | ||
+ | |||
+ | [root]# which ruby | ||
+ | / | ||
+ | |||
+ | [root]# which rails | ||
+ | / | ||
+ | |||
+ | [root]# which rvm | ||
+ | / | ||
+ | |||
+ | [root]# which passenger | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | ===== Finalement... ===== | ||
+ | Au final, rien ne fonctionne, ruby est pour moi une usine à gaz un peu comme nodeJS, ça installe des fichiers | ||
+ | |||
+ | Je vais donc faire marche arrière et tenter de faire le ménage car ruby prend déjà plus d'1 Go de place... | ||
+ | < | ||
+ | # rvm disk-usage all | ||
+ | | ||
+ | Repositories Usage: 257M | ||
+ | | ||
+ | Log Files Usage: 3,9M | ||
+ | Packages Usage: 2,1M | ||
+ | Rubies Usage: 119M | ||
+ | | ||
+ | Wrappers Usage: 296K | ||
+ | | ||
+ | Other Files Usage: 4,2M | ||
+ | Total Disk Usage: 1,1G | ||
+ | |||
+ | </ | ||
+ | |||
+ | Je me lance | ||
+ | < | ||
+ | # rvm remove all | ||
+ | Are you SURE you wish to ' | ||
+ | (anything other than ' | ||
+ | / | ||
+ | Removing / | ||
+ | Removing ruby-1.9.3-p429 aliases... | ||
+ | Removing ruby-1.9.3-p429 wrappers... | ||
+ | Removing ruby-1.9.3-p429 environments... | ||
+ | Removing ruby-1.9.3-p429 binaries... | ||
+ | / | ||
+ | Removing / | ||
+ | Removing ruby-2.0.0-p195 aliases... | ||
+ | Removing ruby-2.0.0-p195 wrappers... | ||
+ | Removing ruby-2.0.0-p195 environments... | ||
+ | Removing ruby-2.0.0-p195 binaries... | ||
+ | |||
+ | |||
+ | # rvm cleanup all | ||
+ | Cleaning up rvm archives | ||
+ | Cleaning up rvm repos | ||
+ | Cleaning up rvm src | ||
+ | Cleaning up rvm log | ||
+ | Cleaning up rvm tmp | ||
+ | Cleaning up rvm gemsets | ||
+ | Cleaning up rvm links | ||
+ | Cleanup done. | ||
+ | |||
+ | </ | ||
+ | On a gagné 1Go | ||
+ | < | ||
+ | # rvm disk-usage all | ||
+ | | ||
+ | Repositories Usage: 4,0K | ||
+ | | ||
+ | Log Files Usage: 4,0K | ||
+ | Packages Usage: 2,1M | ||
+ | Rubies Usage: 4,0K | ||
+ | | ||
+ | Wrappers Usage: 4,0K | ||
+ | | ||
+ | Other Files Usage: 4,1M | ||
+ | Total Disk Usage: 6,2M | ||
+ | </ |