Rails命令大全.doc_第1页
Rails命令大全.doc_第2页
Rails命令大全.doc_第3页
Rails命令大全.doc_第4页
全文预览已结束

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Rails命令大全1.1 创建一个Rails应用程序$ rails app_name可选项:-d, database=xxx 指定安装一个数据库(mysql oracle postgresql sqlite2 sqlite3 ), 默认情况下是数据库-r, ruby-path= 指定Ruby的安装路径,如果没有指定,scripts使用env去找Ruby -f, freeze (冻结)freezes Rails在vendor/rails目录1.2 API Documentation$ gem_server启动一个WEBrick服务器。这时候你可以通过Http:/localhost:8808/ 打开浏览器去查看rails API文档1.3 Rakerake db:fixtures:load # 载入fixtures到当前环境的数据库 # 载入指定的fixtures使用FIXTURES=x,yrake db:migrate # 迁移数据库通过在db/migrate目录下的脚本.可以指定版本号通过VERSION=xrake db:schema:dump # 创建一个db/schema.rb文件,通过AR能过够支持任何数据库去使用rake db:schema:load # 再入一个schema.rb文件进数据库rake db:sessions:clear # 清空sessions表rake db:sessions:create # 用CGI:Session:ActiveRecordStore创建一个sessions表为用户 rake db:structure:dump # 导出数据库结构为一个SQL文件rake db:test:clone # 重新创建一个测试数据库从当前环境数据库中rake db:test:clone_structure # 重新创建测试数据库从开发模式数据库rake db:test:prepare # 准备测试数据库并在入schemarake db:test:purge # 清空测试数据库rake doc:app # 创建HTML文件的API Documentationrake doc:clobber_app # 删除Documentationrake doc:clobber_plugins # 删除 plugin Documentationrake doc:clobber_rails # 删除Documentationrake doc:plugins # 产生Documation为所有安装的pluginsrake doc:rails # 创建HTML文件的API Documentationrake doc:reapp # 强制重新创建HTML文件的API Documentationrake doc:rerails # 强制重新创建HTML文件的API Documentationrake log:clear # 清空目录log/下的所有日志文件rake rails:freeze:edge # Lock this application to latest Edge Rails. Lock a specific revision with REVISION=Xrake 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 gemsrake rails:update # Update both scripts and public/javascripts from Railsrake rails:update:javascripts # Update your javascripts from your current rails installrake rails:update:scripts # Add new scripts to the application script/ directoryrake stats # Report code statistics (KLOCs, etc) from the applicationrake test # Test all units and functionalsrake test:functionals # Run tests for functionalsdb:test:preparerake test:integration # Run tests for integrationdb:test:preparerake test:plugins # Run tests for pluginsenvironmentrake test:recent # Run tests for recentdb:test:preparerake test:uncommitted # Run tests for uncommitteddb:test:preparerake test:units # Run tests for unitsdb:test:preparerake tmp:cache:clear # 清空tmp/cache目录下的所有文件rake tmp:clear # 清空session, cache, 和socket文件从tmp/目录rake tmp:create # 为sessions, cache, and sockets创建tmp/目录rake tmp:sessions:clear # 清空所有在tmp/sessions目录下的文件rake tmp:sockets:clear # 清空所有在tmp/sessions 目录下的ruby_sess.* 文件1.4 Scriptsscript/about # 输出当前环境信息script/breakpointer # 启动断点serverscript/console # 启动交换式的Rails控制台script/destroy # 删除通过generators创建的文件script/generate # - generatorsscript/plugin # - Pluginsscript/runner # 执行一个任务在rails上下文中script/server # 启动开发模式服务器http:/localhost:3000/以下几个不知道怎么去使用script/performance/profiler script/performance/benchmarker script/process/reaperscript/process/spawner1.5 Generatorsruby script/generate model ModelNameruby script/generate controller ListController show editruby script/generate scaffold ModelName ControllerNameruby script/generate migration AddNewTableruby script/generate plugin PluginNameruby script/generate mailer Notification lost_password signupruby script/generate web_service ServiceName api_one api_tworuby script/generate integration_test TestNameruby script/generate session_migration可选项:-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 sub

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论