Skip to content

Instantly share code, notes, and snippets.

@magikcypress
Created October 21, 2012 15:51
Show Gist options
  • Save magikcypress/3927322 to your computer and use it in GitHub Desktop.
Save magikcypress/3927322 to your computer and use it in GitHub Desktop.

Installation Ruby On Rails

Installer rvm

Pour ruby

  $ curl -L https://get.rvm.io | bash -s stable --ruby

Pour rails

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

Creer un répertoire pour rvm et la configuration

  $ echo "~/.rvm/bin/rvm cyp@monapplication" > .rvmrc

Utiliser la dernière version de ruby

  $ rvm install ruby-1.9.3
  $ rvm use 1.9.3
  $ ruby -v
  ruby 1.9.3p286 (2012-10-12 revision 37165) [x86_64-linux]

Screencast intéressant pour apprendre à utiliser rvm

http://screencasts.org/episodes/how-to-use-rvm

Installer rails

  $ gem install rails

Verifier la version de rails et de ruby

  $ rails -v
  Rails 3.2.8
  
  $ ruby -v
  ruby 1.9.3p286 (2012-10-12 revision 37165) [x86_64-linux]

Creer son application

  $ rails new monapplication

Install essential

  $ bundle install

Creer la database

  $ rake db:create

Generer le controller

  $ rails generate controller Article

Generer le model

  $ rails generate model Article title:string body:text

Installer la table

  $ rake db:migrate

Start server

  $ rails server

Installer la pagination

  $ gem install will-paginate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment