Outils pour utilisateurs

Outils du site


tech:install-ruby-on-rails-activeadmin

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
tech:install-ruby-on-rails-activeadmin [2025/03/24 15:06] – créée - modification externe 127.0.0.1tech:install-ruby-on-rails-activeadmin [2026/06/07 19:12] (Version actuelle) – modification externe 127.0.0.1
Ligne 1: Ligne 1:
 +<!DOCTYPE markdown>
 +{{tag>Web Ruby}}
 +
 +# Install Ruby On Rails - ActiveAdmin
 +
 +Install de Ryby et Rails avec RVM
 +<http://rvm.io/rvm/install>
 +
 +~~~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
 +
 +<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
 +~~~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 <CTRL>+<C> 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
 +
 +<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>
 +~~~
 + 
  

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki