Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
rubyonrails [Le 16/07/2017, 23:10] – recyclage et corrections, nettoyage J5012 | rubyonrails [Le 05/05/2019, 13:53] (Version actuelle) – "ails new $HOME/weblog" corrigé en "rails new $HOME/weblog" 78.233.151.117 | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
+ | {{tag> | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ====== Rails (ou Ruby on Rails dit aussi RoR) ====== | ||
+ | |||
+ | Rails est un cadriciel libre orienté dans le développement d' | ||
+ | ===== Pré-requis ===== | ||
+ | |||
+ | * Disposer des [[: | ||
+ | * Disposer d'une connexion à Internet configurée et activée. | ||
+ | |||
+ | ===== Installation ===== | ||
+ | |||
+ | Pour installer ce logiciel, il suffit d' | ||
+ | |||
+ | ===== Configuration ===== | ||
+ | |||
+ | La configuration de Rails s' | ||
+ | |||
+ | Pour modifier le comportement de Rails lui-même, utilisez les options sur la ligne de commande : | ||
+ | < | ||
+ | |||
+ | que vous pouvez aussi obtenir avec juste la commande __rails__ ou : | ||
+ | <code bash> | ||
+ | rails new -h | ||
+ | Usage: | ||
+ | rails new APP_PATH [options] | ||
+ | |||
+ | Options: | ||
+ | -r, [--ruby=PATH] | ||
+ | # Default: / | ||
+ | -m, [--template=TEMPLATE] | ||
+ | [--skip-gemfile], | ||
+ | -B, [--skip-bundle], | ||
+ | -G, [--skip-git], | ||
+ | [--skip-keeps], | ||
+ | -O, [--skip-active-record], | ||
+ | -S, [--skip-sprockets], | ||
+ | [--skip-spring], | ||
+ | -d, [--database=DATABASE] | ||
+ | # Default: sqlite3 | ||
+ | -j, [--javascript=JAVASCRIPT] | ||
+ | # Default: jquery | ||
+ | -J, [--skip-javascript], | ||
+ | [--dev], [--no-dev] | ||
+ | [--edge], [--no-edge] | ||
+ | [--skip-turbolinks], | ||
+ | -T, [--skip-test-unit], | ||
+ | [--rc=RC] | ||
+ | [--no-rc], [--no-no-rc] | ||
+ | |||
+ | Runtime options: | ||
+ | -f, [--force] | ||
+ | -p, [--pretend], | ||
+ | -q, [--quiet], [--no-quiet] | ||
+ | -s, [--skip], [--no-skip] | ||
+ | |||
+ | Rails options: | ||
+ | -h, [--help], [--no-help] | ||
+ | -v, [--version], | ||
+ | |||
+ | Description: | ||
+ | The 'rails new' command creates a new Rails application with a default | ||
+ | directory structure and configuration at the path you specify. | ||
+ | |||
+ | You can specify extra command-line arguments to be used every time | ||
+ | 'rails new' runs in the .railsrc configuration file in your home directory. | ||
+ | |||
+ | Note that the arguments specified in the .railsrc file don't affect the | ||
+ | defaults values shown above in this help message. | ||
+ | |||
+ | Example: | ||
+ | rails new ~/ | ||
+ | |||
+ | This generates a skeletal Rails installation in ~/ | ||
+ | See the README in the newly created application to get going. | ||
+ | </ | ||
+ | ===== Utilisation ===== | ||
+ | |||
+ | ==== Créez votre première application Rails (Hello, Rails !) ==== | ||
+ | |||
+ | * Générez le squelette de l' | ||
+ | <code bash> | ||
+ | rails new $HOME/ | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | create | ||
+ | | ||
+ | Resolving dependencies... | ||
+ | Using rake 10.5.0 | ||
+ | Using i18n 0.7.0 | ||
+ | Using json 1.8.3 | ||
+ | Using minitest 5.8.4 | ||
+ | Using thread_safe 0.3.5 | ||
+ | Using builder 3.2.2 | ||
+ | Using erubis 2.7.0 | ||
+ | Using nokogiri 1.6.7.2 | ||
+ | Using rack 1.6.4 | ||
+ | Using mime-types 2.6.1 | ||
+ | Using arel 6.0.3 | ||
+ | Using debug_inspector 0.0.2 | ||
+ | Using bundler 1.11.2 | ||
+ | Using columnize 0.9.0 | ||
+ | Using coffee-script-source 1.9.1.1 | ||
+ | Using execjs 2.6.0 | ||
+ | Using thor 0.19.1 | ||
+ | Using multi_json 1.11.2 | ||
+ | Using rdoc 4.2.1 | ||
+ | Using sass 3.4.21 | ||
+ | Using tilt 2.0.1 | ||
+ | Using spring 1.3.6 | ||
+ | Using sqlite3 1.3.11 | ||
+ | Using tzinfo 1.2.2 | ||
+ | Using loofah 2.0.3 | ||
+ | Using rack-test 0.6.3 | ||
+ | Using sprockets 3.3.0 | ||
+ | Using mail 2.6.3 | ||
+ | Using binding_of_caller 0.7.2 | ||
+ | Using byebug 5.0.0 | ||
+ | Using coffee-script 2.4.1 | ||
+ | Using uglifier 2.7.2 | ||
+ | Using sdoc 0.4.1 | ||
+ | Using activesupport 4.2.6 | ||
+ | Using rails-html-sanitizer 1.0.3 | ||
+ | Using rails-deprecated_sanitizer 1.0.3 | ||
+ | Using globalid 0.3.6 | ||
+ | Using activemodel 4.2.6 | ||
+ | Using jbuilder 2.3.1 | ||
+ | Using rails-dom-testing 1.0.6 | ||
+ | Using activejob 4.2.6 | ||
+ | Using activerecord 4.2.6 | ||
+ | Using actionview 4.2.6 | ||
+ | Using actionpack 4.2.6 | ||
+ | Using actionmailer 4.2.6 | ||
+ | Using railties 4.2.6 | ||
+ | Using sprockets-rails 2.3.2 | ||
+ | Using coffee-rails 4.1.0 | ||
+ | Using jquery-rails 4.0.5 | ||
+ | Using rails 4.2.6 | ||
+ | Using sass-rails 5.0.4 | ||
+ | Using web-console 2.2.1 | ||
+ | Using turbolinks 2.5.3 | ||
+ | Bundle complete! 12 Gemfile dependencies, | ||
+ | Use `bundle show [gemname]` to see where a bundled gem is installed. | ||
+ | | ||
+ | * bin/rake: spring inserted | ||
+ | * bin/rails: spring inserted | ||
+ | </ | ||
+ | * Lancez ensuite le serveur Rails pour exécuter l' | ||
+ | <code bash>cd $HOME/ | ||
+ | bin/rails server | ||
+ | => Booting WEBrick | ||
+ | => Rails 4.2.6 application starting in development on http:// | ||
+ | => Run `rails server -h` for more startup options | ||
+ | => Ctrl-C to shutdown server | ||
+ | [2017-07-17 01:28:37] INFO WEBrick 1.3.1 | ||
+ | [2017-07-17 01:28:37] INFO ruby 2.3.1 (2016-04-26) [x86_64-linux-gnu] | ||
+ | [2017-07-17 01:28:37] INFO WEBrick:: | ||
+ | |||
+ | |||
+ | Started GET "/" | ||
+ | Processing by Rails:: | ||
+ | Rendered / | ||
+ | Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: | ||
+ | </ | ||
+ | < | ||
+ | * la base préconfigurée de l' | ||
+ | <code bash>cd $HOME/ | ||
+ | rake db: | ||
+ | * l' | ||
+ | < | ||
+ | </ | ||
+ | * Lancez le navigateur web à l' | ||
+ | < | ||
+ | {{:: | ||
+ | ==== Utilisations avancées ==== | ||
+ | |||
+ | Les utilisateurs et programmeurs avancés pourront configurer Rails avec d' | ||
+ | * modules [[https:// | ||
+ | |||
+ | ou d' | ||
+ | ===== Désinstallation ===== | ||
+ | |||
+ | Pour supprimer cette application, | ||
+ | |||
+ | ===== Voir aussi ===== | ||
+ | |||
+ | * **(en)** [[http:// | ||
+ | * **(fr)** [[wpfr> | ||
+ | * **(fr)** [[http:// | ||
+ | |||
+ | ---- | ||
+ | // | ||
+ | |||
+ | //Basé sur [[http:// | ||