資源描述:
《Rails命令大全》由會員上傳分享,免費在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫。
1、Rails命令大全1.1創(chuàng)建一個Rails應(yīng)用程序$railsapp_name可選項:-d,database=xxx指定安裝一個數(shù)據(jù)庫(mysqloraclepostgresqlsqlite2sqlite3),默認(rèn)情況下是數(shù)據(jù)庫-r,ruby-path=指定Ruby的安裝路徑,如果沒有指定,scripts使用env去找Ruby-f,freeze(凍結(jié))freezesRails在vendor/rails目錄1.2APIDocumentation$gem_server啟動一個WEBrick服務(wù)器。這時候你可以通過Http://localhost:8
2、808/打開瀏覽器去查看railsAPI文檔1.3Rakerakedb:fixtures:load??#載入fixtures到當(dāng)前環(huán)境的數(shù)據(jù)庫??#載入指定的fixtures使用FIXTURES=x,yrakedb:migrate#遷移數(shù)據(jù)庫通過在db/migrate目錄下的腳本.可以指定版本號通過VERSION=xrakedb:schema:dump#創(chuàng)建一個db/schema.rb文件,通過AR能過夠支持任何數(shù)據(jù)庫去使用rakedb:schema:load#再入一個schema.rb文件進(jìn)數(shù)據(jù)庫rakedb:sessions:clear#清
3、空sessions表rakedb:sessions:create#用CGI::Session::ActiveRecordStore創(chuàng)建一個sessions表為用戶rakedb:structure:dump#導(dǎo)出數(shù)據(jù)庫結(jié)構(gòu)為一個SQL文件rakedb:test:clone#重新創(chuàng)建一個測試數(shù)據(jù)庫從當(dāng)前環(huán)境數(shù)據(jù)庫中rakedb:test:clone_structure#重新創(chuàng)建測試數(shù)據(jù)庫從開發(fā)模式數(shù)據(jù)庫rakedb:test:prepare#準(zhǔn)備測試數(shù)據(jù)庫并在入schemarakedb:test:purge#清空測試數(shù)據(jù)庫rakedoc:app#創(chuàng)
4、建HTML文件的APIDocumentationrakedoc:clobber_app#刪除Documentationrakedoc:clobber_plugins#刪除pluginDocumentationrakedoc:clobber_rails#刪除Documentationrakedoc:plugins#產(chǎn)生Documation為所有安裝的pluginsrakedoc:rails#創(chuàng)建HTML文件的APIDocumentationrakedoc:reapp#強制重新創(chuàng)建HTML文件的APIDocumentationrakedoc:rer
5、ails#強制重新創(chuàng)建HTML文件的APIDocumentationrakelog:clear#清空目錄log/下的所有日志文件rakerails:freeze:edge#LockthisapplicationtolatestEdgeRails.LockaspecificrevisionwithREVISION=Xrakerails:freeze:gems#Lockthisapplicationtothecurrentgems(byunpackingthemintovendor/rails)rakerails:unfreeze#Unlockth
6、isapplicationfromfreezeofgemsoredgeandreturntoafluiduseofsystemgemsrakerails:update#Updatebothscriptsandpublic/javascriptsfromRailsrakerails:update:javascripts#Updateyourjavascriptsfromyourcurrentrailsinstallrakerails:update:scripts#Addnewscriptstotheapplicationscript/direct
7、oryrakestats#Reportcodestatistics(KLOCs,etc)fromtheapplicationraketest#Testallunitsandfunctionalsraketest:functionals??#Runtestsforfunctionalsdb:test:prepareraketest:integration#Runtestsforintegrationdb:test:prepareraketest:plugins#Runtestsforpluginsenvironmentraketest:recen
8、t#Runtestsforrecentdb:test:prepareraketest:uncommitted#Runtestsforuncommitt