Some of useful Rails3 Commands and their descriptions are listed below:
rails new ApplicationName – Create a new application
rails new ApplicationName -d mysql - Create a new application use MySQL
rails generate/g model ModelName – Creates a model with the specified model_name
rails generate/g controller ControllerName – Creates a controller with the specified controller_name
rails generate/g migration MigrationName – Creates a migration with the specified migration_name
rails generate/g scaffold ModelName ControllerName – A shortcut for creating your controller, model and view files etc.
rails destroy controller ControllerName – Destroys the created controller and its related file. Same way you can destroy your model, migration files etc.
rails server/s – start ruby server at http://localhost:3000
rails plugin install PluginName – Installs the specified plugin.
rails console/c – Opens the rails console for the current RAILS_ENV
rails dbconsole/db – Opens the DB console for the current RAILS_ENV
rails performance – For benchmarkering and profiling your application.
rake –tasks – Lists all available rake tasks
rake db:create – Create the database defined in config/database.yml for the current RAILS_ENV
rake db:drop – Drops the database for the current RAILS_ENV
rake db:migrate – Migrate the database through scripts in db/migrate folder.
rake db:reset – Drops and recreates the database from db/schema.rb for the current environment.
rake db:rollback – This will run the down method from the latest migration.
rake db:schema:dump – Create a db/schema.rb file that can be portably used against any DB supported by AR
rake doc:app – Build the RDOC HTML Files
rake db:sessions:create – Creates a sessions migration for use with CGI::Session::ActiveRecordStore
rake gems – List the gems that this rails application depends on
rake gems:install – Installs all required gems for this application.
rake log:clear – Truncates all *.log files in log/ to zero bytes
rake rails:freeze:gems – Lock this application to the current gems (by unpacking them into vendor/rails)
rake routes – Print out all defined routes in match order, with names.
rake test – Run all unit, functional and integration tests
rake test:functionals – Run tests for functionalsdb:test:prepare / Run the functional tests in test/functional
rake test:integration – Run tests for integrationdb:test:prepare / Run the integration tests in test/integration
rake test:units – Run tests for unitsdb:test:prepare / Run the unit tests in test/unit
rake tmp:clear – Clear session, cache, and socket files from tmp/
gem list – Lists all the installed gems.
gem install GemName – Installs the specified gem in to your machine.
gem uninstall GemName – Uninstalls the specified gem from your machine.
gem server – present a web page at http://localhost:8808/ with info about installed gems.
分享到:
相关推荐
Rails_3_Cheat_Sheets.pdf
### Ruby on Rails Cheat Sheet 本篇文章将从给定的文件中提炼出关于Ruby on Rails的重要知识点,主要包括命令、URL映射、命名规范、ERB标签、链接创建、数据库配置及查询、模型之间的关系等方面。 #### Ruby on ...
Rails3 是 Ruby on Rails 框架的一个版本,它提供了一系列强大的命令行工具,使得开发者可以快速地构建和管理Web应用。在本文中,我们将深入探讨Rails3中的常用命令,帮助你更高效地进行开发工作。 首先,新建一个...
《Ruby on Rails 3 Tutorial》是一本专门为初学者设计的指南,旨在帮助读者快速掌握Ruby on Rails这一强大的Web开发框架。Ruby on Rails(简称Rails)是基于Ruby语言的一个开源框架,它采用MVC(Model-View-...
《Rails 3 in Action》是2011年由Ryan Bigg撰写的一本关于Ruby on Rails框架的权威指南,专门针对当时最新的Rails 3.1版本进行了深入解析。这本书旨在帮助开发者充分利用Rails 3.1的强大功能,提升Web应用开发的效率...
### CentOS环境下Rails 3开发环境搭建详解 #### 一、准备工作与环境配置 在开始部署Rails 3开发环境之前,我们需要确保系统上已经安装了一些基本的软件包和工具。这一步骤对于后续的Ruby和Rails安装至关重要。 ##...
turbo-sprockets-rails3, 加速你的Rails 3资产 用于 Rails 3.2.x的涡轮链轮 通过只根据源文件的哈希来重新编译已经更改的资产,从而加快 Rails 3 rake assets:precompile的速度只编译一次以生成指纹和非打印的资产...
Ruby on Rails 3 是一个基于Ruby编程语言的开源Web应用程序框架,它遵循MVC(Model-...提供的文档如"Ruby192和Rails3.0.3的新征程.doc"和"rails3入门教程.pdf"等,将有助于深入理解这一框架及其在实际项目中的应用。
### Rails 3升级手册知识点详解 #### 一、Rails 3升级手册概览 本手册是一份详尽的指南,旨在帮助开发者顺利完成从旧版本Rails到Rails 3的升级过程。手册共包含近120页的内容,覆盖了升级过程中所需的所有关键信息...
在“Ruby Rails 3 Linda”这一主题中,我们将会深入探讨Rails 3版本的相关知识点。 1. **安装与设置**:首先,学习如何在本地环境中安装Ruby、RubyGems和Rails。Ruby版本管理器如RVM(Ruby Version Manager)或...
The Rails™ 3 Way is the only comprehensive, authoritative guide to delivering production-quality code with Rails 3. Pioneering Rails expert Obie Fernandez and a team of leading experts illuminate ...
基于java的开发源码-Rails3消息队列系统 Sidekiq.zip 基于java的开发源码-Rails3消息队列系统 Sidekiq.zip 基于java的开发源码-Rails3消息队列系统 Sidekiq.zip 基于java的开发源码-Rails3消息队列系统 Sidekiq.zip ...
### Ruby on Rails 3 教程知识点解析 #### 标题与描述中的核心知识点 - **Ruby on Rails 3**:一种流行的Web开发框架,基于Ruby语言。 - **经典教材**:表明本书是学习Ruby on Rails 3的一个权威且广受好评的资源...
Rails3 是 Ruby on Rails 框架的一个版本,它在2010年发布,引入了许多新特性并改进了框架的性能。Rake 是 Ruby 的一个构建工具,类似于 Java 的 Ant 或者 Python 的 setup.py,它允许开发者用自然语言定义任务,并...
### 关于《Rails 3 的方式》第二版的知识点总结 #### 一、书籍概述与评价 《Rails 3 的方式》(The Rails 3 Way, 2nd Edition)是一本深入探讨Ruby on Rails框架(简称Rails)的技术书籍。本书不仅涵盖了Rails 3的...
Rails3消息队列系统 Sidekiq
Ruby+on+Rails+3+Tutorial.pdf 应用Rails进行敏捷Web开发第4版.pdf (Agile Web Development with Rails) Rails.Recipes.Rails.3.Edition.pdf
### 关于《Beginning Rails 3》的关键知识点 #### 一、书籍概述 《Beginning Rails 3》是由Cloves Carneiro Jr. 和 Rida Al Barazi共同编写的关于使用Ruby on Rails框架进行Web开发的入门级教程。该书旨在帮助初学...