Install Ruby On Rails - ActiveAdmin

Install de Ryby et Rails avec RVMVoir RVM

curl -sSL https://get.rvm.io | bash -s stable --rails

Install de sqlite vraiment nécessaire !?

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 :Voir Tuto

gem 'pg' gem 'activeadmin', github: 'gregbell/active_admin' gem 'execjs' gem 'therubyracer'

Accès à la DB

Configurez le fichier config/database.yml

bundle install

Démarré le serveur (port TCP 3000 par défaut)Seulement pour test. Pas nécessaire

rails server

Puis Ctrl + C pour stopper le serveur.

Apache

Install de mod_passenger

gem install passenger

(passenger-install-apache2-module)

yum install libcurl-devel httpd-devel

exemple de conf apache

LoadModule passenger_module modules/mod_passenger.so <IfModule mod_passenger.c> PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-3.0.21 PassengerRuby /usr/bin/ruby </IfModule> # 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: # # <VirtualHost *:80> # RailsEnv production # ServerName www.yourhost.com # DocumentRoot /somewhere/public # <-- be sure to point to 'public'! # <Directory /somewhere/public> # AllowOverride all # <-- relax Apache security settings # Options -MultiViews # <-- MultiViews must be turned off # </Directory> # </VirtualHost>

Notes en vrac

Prérequis RoR

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 :

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 serverPuis <CTRL>+<C> pour stopper le serveur.

Apache

Install de mod_passenger

gem install passenger(passenger-install-apache2-module)

Yum install libcurl-develhttpd-devel

LoadModule passenger_module modules/mod_passenger.so <IfModule mod_passenger.c> PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-3.0.21 PassengerRuby /usr/bin/ruby </IfModule> # 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: # # <VirtualHost *:80> # RailsEnv production # ServerName www.yourhost.com # DocumentRoot /somewhere/public # <-- be sure to point to 'public'! # <Directory /somewhere/public> # AllowOverride all # <-- relax Apache security settings # Options -MultiViews # <-- MultiViews must be turned off # </Directory> # </VirtualHost>