Ruby on Rails ÃüÁî²Î¿¼
1.1.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 Rake
rake db:fixtures:load
# ÔØÈëfixturesµ½µ±Ç°»·¾³µÄÊý¾Ý¿â
# ÔØÈëÖ¸¶¨µÄfixturesʹÓÃFIXTURES=x,y
rake db:migrate
# ǨÒÆÊý¾Ý¿âͨ¹ýÔÚdb/migrateĿ¼ÏµĽű¾.¿ÉÒÔÖ¸¶¨°æ±¾ºÅͨ¹ýVERSION=x
rake 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:testrepare
# ×¼±¸²âÊÔÊý¾Ý¿â²¢ÔÚÈëschema
rake db:testurge
# Çå¿Õ²âÊÔÊý¾Ý¿â
rake doc:app
# ´´½¨HTMLÎļþµÄAPI Documentation
rake doc:clobber_app
# ɾ³ýDocumentation
rake doc:clobber_plugins
# ɾ³ý plugin Documentation
rake doc:clobber_rails
# ɾ³ýDocumentation
rake doclugins
# ²úÉúDocumationΪËùÓа²×°µÄplugins
rake doc:rails
# ´´½¨HTMLÎļþµÄAPI Documentation
rake doc:reapp
# Ç¿ÖÆÖØд´½¨HTMLÎļþµÄAPI Documentation
rake doc:rerails
# Ç¿ÖÆÖØд´½¨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 scripts and public/ja
Ïà¹ØÎĵµ£º
#Ò»¡¢Ä£¿é¶¨Òå¼°ÒýÓã¬Ä£¿é¾ÍÊÇÒ»¶Î´úÂ룬ÀïÃæÓÐһЩ·½·¨·ÅÒ»Æð¡£
#¶¨ÒåÄ£¿éÓÃmodule...end ¡£Ä£¿éÓëÀà·Ç³£ÏàËÆ£¬µ«ÊÇ£º
#A) Ä£¿é²»¿ÉÒÔÓÐʵÀý¶ÔÏó£»
#B) Ä£¿é²»¿ÉÒÔÓÐ×ÓÀà¡£
include Math
puts sqrt(91);
module Me
def sqrt(a)
puts a*a;
return a*a;
end
PI=3.1415926 ......
Beginning Ruby from Novice To Perfessional
Head First Rails
Agile Web Development with Rails 3rd Edition(new)
Agile Web Development with Rails 3rd Edition
Agile Web Development with Rails 3rd Editio ......
ϲ»¶Íæ°¢ÔÂϵÁÐRPGÓÎÏ·µÄÎÒ£¬¸ú²»ÉÙͯЬһÑùÏÂÁËRPGMakerXPÀ´Õ°Ñöһϡ£µ±Ê±¾õµÃÕâ¸öÈí¼þÌ«·½±ãÁË£¬ÓÃÊó±êËæ±ãµãµã¾ÍÄÜŪ³öÀ´¸öÓÐȤµÄСÓÎÏ·¡£ÒòΪÀïÃæ²»½ö×Ô´ø²»ÉÙµØͼºÍÈËÎïÐÐ×ßͼµÈËزģ¬ÈÝÒ×ÉÏÊֵIJÙ×÷·½Ê½Ò²ÈÃ×Ô¼º´óÓгɾ͸Ѕ…¿ÉÊÇÓÎÏ·±Ï¾¹ÊÇÀë²»¿ª±à³Ì£¬½â¿ªÓÎÏ·°ü£¬¿´ ......
Ruby£¬Ò»ÖÖ為簡單¿ì½ÝÎï¼þ導Ïò編³Ì£¨ÃæÏò¶ÔÏó³ÌÐòÉè¼Æ£©¶ø創µÄ½Å±¾語ÑÔ£¬ÔÚ20ÊÀ¼Í90Äê´úÓÉÈÕ±¾ÈËËɱ¾Ðк루¤Þ¤Ä¤â¤È¤æ¤¤Ò¤í£¯Yukihiro Matsumoto£©¿ª·¢£¬×ñÊØGPLÐÒéºÍRuby License¡£ËüµÄÁé¸ÐÓëÌØÐÔÀ´×ÔÓÚPerl¡¢Smalltalk¡¢Eiffel¡¢Ada ÒÔ¼° Lisp ......
ת×Ô http://www.advidea.cn/biancheng/200943135232.html
Ruby watir ²âÊÔ¿ò¼Ü
´ó¶àÊýÈ˶¼»á°²×° ruby,
Ҳͨ¹ýRuby °²×° gem,
Ò²°²×°ÁËruby IDE¿ª·¢¹¤¾ß£ºnetbeans,
µ«¾ÍÊDz»ÄÜÅÜwatir»·¾³£¬¿ñÔμÓÍÂÖС£¡£¡£
´íÎóÈçÏ£º
in `require': no such file to load -- watir (LoadError)
·´Õý¾ÍÊÇÕÒ²»µ½watir,ÕâÀï ......