日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

ROR 命令大全

發(fā)布時(shí)間:2025/3/13 编程问答 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ROR 命令大全 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
1.1 創(chuàng)建一個Rails應(yīng)用程序
?$ rails app_name
?可選項(xiàng):
?-d, database=xxx 指定安裝一個數(shù)據(jù)庫(mysql oracle postgresql sqlite2 sqlite3 ), 默認(rèn)情況下是數(shù)據(jù)庫
?-r, ruby-path= 指定Ruby的安裝路徑,如果沒有指定,scrīpts使用env去找Ruby
?-f, freeze (凍結(jié))freezes Rails在vendor/rails目錄
?
1.2 API Documentation
?$ gem_server
?啟動一個WEBrick服務(wù)器。這時(shí)候你可以通過Http://localhost:8808/ 打開瀏覽器去查看rails API文檔
?
1.3 Rake
?rake db:fixtures:load
? # 載入fixtures到當(dāng)前環(huán)境的數(shù)據(jù)庫
? # 載入指定的fixtures使用FIXTURES=x,y
?rake db:migrate
?# 遷移數(shù)據(jù)庫通過在db/migrate目錄下的腳本.可以指定版本號通過VERSION=x
?rake db:schema:dump
?# 創(chuàng)建一個db/schema.rb文件,通過AR能過夠支持任何數(shù)據(jù)庫去使用
?rake db:schema:load
?# 再入一個schema.rb文件進(jìn)數(shù)據(jù)庫
?rake db:sessions:clear
?# 清空sessions表
?rake db:sessions:create
?# 用CGI::Session::ActiveRecordStore創(chuàng)建一個sessions表為用戶
?rake db:structure:dump
?# 導(dǎo)出數(shù)據(jù)庫結(jié)構(gòu)為一個SQL文件
?rake db:test:clone
?# 重新創(chuàng)建一個測試數(shù)據(jù)庫從當(dāng)前環(huán)境數(shù)據(jù)庫中
?rake db:test:clone_structure
?# 重新創(chuàng)建測試數(shù)據(jù)庫從開發(fā)模式數(shù)據(jù)庫
?rake db:test:prepare
?# 準(zhǔn)備測試數(shù)據(jù)庫并在入schema
?rake db:test:purge
?# 清空測試數(shù)據(jù)庫
?rake doc:app
?# 創(chuàng)建HTML文件的API Documentation
?rake doc:clobber_app
?# 刪除Documentation
?rake doc:clobber_plugins
?# 刪除 plugin Documentation
?rake doc:clobber_rails
?# 刪除Documentation
?rake doc:plugins
?# 產(chǎn)生Documation為所有安裝的plugins
?rake doc:rails
?# 創(chuàng)建HTML文件的API Documentation
?rake doc:reapp
?# 強(qiáng)制重新創(chuàng)建HTML文件的API Documentation
?rake doc:rerails
?# 強(qiáng)制重新創(chuàng)建HTML文件的API Documentation
?rake log:clear
?# 清空目錄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īpts and public/javascrīpts from Rails
?rake rails:update:javascrīpts
?# Update your javascrīpts from your current rails install
?rake rails:update:scrīpts
?# Add new scrīpts to the application scrī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
?# 清空tmp/cache目錄下的所有文件
?rake tmp:clear
?# 清空session, cache, 和socket文件從tmp/目錄
?rake tmp:create
?# 為sessions, cache, and sockets創(chuàng)建tmp/目錄
?rake tmp:sessions:clear
?# 清空所有在tmp/sessions目錄下的文件
?rake tmp:sockets:clear
?# 清空所有在tmp/sessions 目錄下的ruby_sess.* 文件
?
1.4 scrīpts
?scrīpt/about
?# 輸出當(dāng)前環(huán)境信息
?scrīpt/breakpointer
?# 啟動斷點(diǎn)server
?scrīpt/console
?# 啟動交換式的Rails控制臺
?scrīpt/destroy
?# 刪除通過generators創(chuàng)建的文件
?scrīpt/generate
?# -> generators
?scrīpt/plugin
?# -> Plugins
?scrīpt/runner
?# 執(zhí)行一個任務(wù)在rails上下文中
?scrīpt/server
?# 啟動開發(fā)模式服務(wù)器http://localhost:3000
?//以下幾個不知道怎么去使用
?scrīpt/performance/profiler
?scrīpt/performance/benchmarker
?scrīpt/process/reaper
?scrīpt/process/spawner
?
1.5 Generators
?ruby scrīpt/generate model ModelName
?ruby scrīpt/generate controller ListController show edit
?ruby scrīpt/generate scaffold ModelName ControllerName
?ruby scrīpt/generate migration AddNewTable
?ruby scrīpt/generate plugin PluginName
?ruby scrīpt/generate mailer Notification lost_password signup
?ruby scrīpt/generate web_service ServiceName api_one api_two
?ruby scrīpt/generate integration_test TestName
?ruby scrīpt/generate session_migration
?可選項(xiàng):
?-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īpt/plugin install where
?# install the a

轉(zhuǎn)載于:https://www.cnblogs.com/coderlee/archive/2008/01/07/1029136.html

與50位技術(shù)專家面對面20年技術(shù)見證,附贈技術(shù)全景圖

總結(jié)

以上是生活随笔為你收集整理的ROR 命令大全的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。