{{tag>Web Ruby}} # Install Ruby On Rails - ActiveAdmin Install de Ryby et Rails avec RVM ~~~bash curl -sSL https://get.rvm.io | bash -s stable --rails ~~~ Install de sqlite //vraiment nécessaire !?// ~~~bash yum install sqlite-devel ~~~ Ruby Postgres ~~~bash sudo yum install postgresql93-devel export PATH=$PATH:/usr/pgsql-9.3/bin/ gem install pg ~~~ ~~~bash rails new [NomDuSite] cd [NomDuSite] ~~~ Dans le fichier Gemfile : [[https://www.digitalocean.com/community/articles/how-to-install-ruby-on-rails-on-an-debian-7-0-wheezy-vps-using-rvm|Voir Tuto]] `Gemfile` ~~~ruby gem 'pg' gem 'activeadmin', github: 'gregbell/active_admin' gem 'execjs' gem 'therubyracer' ~~~ Accès à la DB Configurez le fichier **config/database.yml** ~~~bash bundle install ~~~ Démarré le serveur (port TCP 3000 par défaut) Seulement pour test. Pas nécessaire ~~~bash rails server ~~~ Puis `Ctrl + C` pour stopper le serveur. Apache Install de mod_passenger ~~~bash gem install passenger ~~~ (passenger-install-apache2-module) ~~~bash yum install libcurl-devel httpd-devel ~~~ exemple de conf apache `passenger.conf` ~~~apache LoadModule passenger_module modules/mod_passenger.so PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-3.0.21 PassengerRuby /usr/bin/ruby # Deploying a Ruby on Rails application: an example # Suppose you have a Rails application in /somewhere. Add a virtual host to # your Apache configuration file and set its DocumentRoot to /somewhere/public: # # # RailsEnv production # ServerName www.yourhost.com # DocumentRoot /somewhere/public # <-- be sure to point to 'public'! # # AllowOverride all # <-- relax Apache security settings # Options -MultiViews # <-- MultiViews must be turned off # # ~~~ ---------- # Notes en vrac Prérequis RoR ~~~bash yum install make gcc openssl-devel zlib-devel gdbm-devel libyaml-devel readline-devel libffi-devel zlib-devel gcc-c++ curl-devel ~~~ ruby cd /root/tar_files/ wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.2.tar.gz tar xvf ruby-2.1.2.tar.gz cd ruby-2.1.2/ mkdir -p /usr/local/blrs/ruby-2.1.2 ./configure --prefix=/usr/local/blrs/ruby-2.1.2 make make install yum install sqlite-devel #Ruby postgres sudo yum install postgresql93-devel export PATH=$PATH:/usr/pgsql-9.3/bin/ gem install pg rails new [NomDuSite] cd [NomDuSite] #Dans le fichier : `Gemfile` ~~~ gem 'pg' gem 'activeadmin', github: 'gregbell/active_admin' gem 'execjs' gem 'therubyracer' ~~~ # Accès à la DB vi config/database.yml bundle install # Démarré le serveur (port TCP 3000 par défaut) : # Seulement pour test. Pas necessaire rails server Puis + pour stopper le serveur. Apache #Install de mod_passenger gem install passenger (passenger-install-apache2-module) Yum install libcurl-devel httpd-devel `passenger.conf` ~~~apache LoadModule passenger_module modules/mod_passenger.so PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-3.0.21 PassengerRuby /usr/bin/ruby # Deploying a Ruby on Rails application: an example # Suppose you have a Rails application in /somewhere. Add a virtual host to # your Apache configuration file and set its DocumentRoot to /somewhere/public: # # # RailsEnv production # ServerName www.yourhost.com # DocumentRoot /somewhere/public # <-- be sure to point to 'public'! # # AllowOverride all # <-- relax Apache security settings # Options -MultiViews # <-- MultiViews must be turned off # # ~~~