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
Ïà¹ØÎĵµ£º
ת×Ô£ºhttp://developer.51cto.com/art/200912/170762.htm
Ruby×Ö·û´®´¦Àíº¯Êý×ܽáÁбí·ÖÏí
Ruby×Ö·û´®´¦Àíº¯Êý°üÀ¨·µ»Ø×Ö·û´®³¤¶Èº¯Êý£»ÅжÏ×Ö·û´®ÖÐÊÇ·ñ°üº¬ÁíÒ»¸ö´®º¯Êý£»×Ö·û´®²åÈ룻×Ö·û´®·Ö¸ô,ĬÈÏ·Ö¸ô·ûΪ¿Õ¸ñµÈµÈ¡£
str.length => integer
str.include? other_str
&nbs ......
To get it done is not easy. I spent a whole day to figure out the various compatibility issues along the way out.
Now there still might be potential issues, but it works by my rough test.
Step 1: Install Apache Cassandra
You may know that the Ruby gem cassandra will do it for you.
  ......
ת Adding Sound to Your Ruby Apps
Have you ever thought about including sounds in your Ruby application? Used sparingly, sound may enhance your applications by adding audio cues or a custom touch. You could, for example, play a beep or chime that announces the completion of a lengthy process. Per ......
¡¡×î½ü£¬ÎÒÐèÒªÒ»ÖÖ¿ìËÙ¿ª·¢ÓïÑÔ£¬Ä¿Ç°ÖËÊÖ¿ÉÈȵĿìËÙ¿ª·¢ÓïÑÔ¾ÍÊÇPythonºÍRubyÁË¡£RubyºÍPython¶¼ÊǷdz£ÓÅÐãµÄ½Å±¾ÓïÑÔ£¬ËäÈ»ËûÃǵÄÉè¼ÆÕÜѧ¼¸ºõÍêÈ«²»Í¬£¬µ«ËûÃÇЧÂʲ¶à£¬Ó¦ÓÃÁìÓòÒ²²î¾à²»´ó£¬ËƺõÌìÉú¾ÍÊǾºÕù¶ÔÊÖ¡£µ½µ×Ñ¡ÄǸöÄØ?ÎÒ×öÁËһЩ¼òµ¥µÄ±È½Ï¡£
¡¡¡¡ÎÒÃDZȽ ......
RubyºÍPythonµÄÓï·¨±È½Ï
ÆäʵRubyºÍPython·Ç³£½Ó½ü£¬±È´ó¶àÊý±ðµÄÓïÑÔÒª½Ó½üµÄ¶à£¬ËùÒÔϲ»¶ÓÃɶ¾ÍÓÃɶ£¨´óʵ»°£¬ËäȻҲÊÇ·Ï»°£©¡£Óï·¨ÉϵIJî±ðËäÈ»ÓÐÄÇôһµã£¬´ó²¿·ÖÊÇsyntax sugar£¬ÎÒ¶·µ¨ÉÔ΢Áм¸¸ö£¨pythonÎÒÒ²ÍüµÃ²î²»¶àÁË£¬²»¶ÔµÄ´ó¼Ò¾¡¹ÜÀ´±Þʬ°É£©£¬µ«ÊÇÖ÷Òª²îÒ컹ÊÇÉè¼ÆË¼ÏëÉϵģºÁé»î ......