Ruby on Rails command Overview

Source: Internet
Author: User
Tags ruby on rails
I. Railway
1.1 create a rails Application Program
$ Rails app_name
Optional:
-D, database = xxx specifies to install a database (MySQL Oracle PostgreSQL sqlite2 sqlite3), which is a database by default
-R, ruby-Path = specifies the ruby installation path. If no path is specified, SCR javaspts uses env to find Ruby.
-F, freeze (freeze) freezes rails in the vendor/rails directory

1.2 API documentation
$ Gem_server
Start a webrick server. In this case, you can use http: // localhost: 8808/to open a browser to view the rails API documentation.

1.3 rake
Rake DB: fixtures: Load
# Load fixtures to the database in the current environment
# Load the specified fixtures using fixtures = x, y
Rake DB: migrate
# Migrate the database through the script in the DB/migrate directory. You can specify the version number through version = x
Rake DB: Schema: Dump
# Create a DB/Schema. RB file and use AR to support any database.
Rake DB: Schema: Load
# Re-enter a schema. RB file into the database
Rake DB: Sessions: Clear
# Clearing the sessions table
Rake DB: Sessions: Create
# Use CGI: Session: activerecordstore to create a sessions table for the user
Rake DB: Structure: Dump
# Export the database structure as an SQL File
Rake DB: Test: Clone
# Recreate a test database from the current environment database
Rake DB: Test: clone_structure
# Recreate the test database from the Development Mode Database
Rake DB: Test: Prepare
# Prepare the test database and import the schema
Rake DB: Test: purge
# Clearing the Test Database
Rake DOC: app
# Create an HTML file API documentation
Rake DOC: clobber_app
# Delete documentation
Rake DOC: clobber_plugins
# Delete plugin documentation
Rake DOC: clobber_rails
# Delete documentation
Rake DOC: plugins
# Generate deployment for all installed plugins
Rake DOC: rails
# Create an HTML file API documentation
Rake DOC: reapp
# Force re-create the HTML file API documentation
Rake DOC: rerails
# Force re-create the HTML file API documentation
Rake log: Clear
# Clear all log files in the directory log/
Rake rails: Freeze: edge
# Lock this application to latest edge rails. Lock a specific revision with revision = x
Rake rails: Freeze: gems
# Lock this application to the current gems (by unpacking them into vendor/rails)
Rake rails: unfreeze
# Unlock this application from freeze of gems or edge and return to a fluid use of system gems
Rake rails: Update
# Update both SCR merge PTS and public/merge Cr merge PTS from rails
Rake rails: Update: javascr javaspts
# Update your into Cr into PTS from your current rails install
Rake rails: Update: SCR merge PTS
# Add New SCR into PTS to the application SCR into Pt/directory
Rake stats
# Report code statistics (klocs, etc) from the application
Rake Test
# Test all units and FUNCTIONALS
Rake test: FUNCTIONALS
# Run tests for functionalsdb: Test: Prepare
Rake test: Integration
# Run tests for integrationdb: Test: Prepare
Rake test: plugins
# Run tests for pluginsenvironment
Rake test: Recent
# Run tests for recentdb: Test: Prepare
Rake test: uncommitted
# Run tests for uncommitteddb: Test: Prepare
Rake test: Units
# Run tests for unitsdb: Test: Prepare
Rake TMP: cache: Clear
# Clear all objects in the tmp/cache directory
Rake TMP: Clear
# Clear session, cache, and socket files from the tmp/directory
Rake TMP: Create
# Create the tmp/directory for sessions, cache, and sockets
Rake TMP: Sessions: Clear
# Clear all files in the tmp/sessions directory
Rake TMP: sockets: Clear
# Clear all ruby_sess. * files in the tmp/sessions directory

1.4 SCR limit PTS
SCR limit Pt/about
# output current Environment Information
SCR limit Pt/breakpointer
# Start the breakpoint server
SCR release Pt/console
# Start the exchange-type rails console
SCR release Pt/destroy
# delete files created through generators
SCR release Pt/ generate
#-> generators
SCR ready Pt/plugin
#-> plugins
SCR ready Pt/runner
# execute a task in rails in the context
SCR sans Pt/server
# Start the Development Mode Server HTTP: // localhost: 3000
// do not know how to use the following:
SCR limit Pt/performance/profiler
SCR limit Pt/performance/benchmarker
SCR limit Pt/ process/reaper
SCR accept Pt/process/spawner

1.5 generators
Ruby SCR limit Pt/generate model modelname
Ruby SCR limit Pt/generate controller listcontroller show edit
Ruby SCR limit Pt/generate scaffold modelname controllername
Ruby SCR limit Pt/generate migration addnewtable
Ruby SCR limit Pt/generate plugin pluginname
Ruby SCR limit Pt/generate Mailer notification lost_password signup
Ruby SCR limit Pt/generate web_service servicename api_one api_two
Ruby SCR limit Pt/generate integration_test testname
Ruby SCR limit Pt/generate session_migration
option:
-P, -- pretend run but do not make any changes.
-F, -- force overwrite files that already exist.
-S, -- Skip skip files that already exist.
-Q, -- Quiet suppress normal output.
-T, -- backtrace debugging: Show backtrace on errors.
-h, -- help show this help message.
-C, -- SVN modify files with subversion. (Note: SVN must be in path)

1.6 plugins
SCR ī Pt/plugin discover
# discover plugin repositories
SCR ī Pt/plugin list
# list all available plugins
SCR merge Pt/plugin install where
# Install the

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.