ruby ×Ö·û´® Àí½â "" ''
rubyÖе¥ÒýºÅºÍË«ÒýºÅµÄÒâÒåÓÐËù²»Í¬£¬Ë«ÒýºÅ°üΧµÄ×Ö·û×÷±äÁ¿Ìæ»»£¬µ¥ÒýºÅ°üΧµÄ±äÁ¿²»×öÌæ»»
Ò²¿ÉÒÔʹÓà %q ºÍ %Q À´Éú³É×Ö·û´®¶ÔÏó¡£%q Ï൱ÓÚµ¥ÒýºÅ£¬%QÏ൱ÓÚË«ÒýºÅ¡£
¾ÙÀýÈçÏ£º
irb(main):010:0> "show trsult: #{1*3}"
=> "show trsult: 3"
irb(main):011:0> 'show trsult: #{1*3}'
=> "show trsult: \#{1*3}"
Ïà¹ØÎĵµ£º
ruby³£¹æ·ÃÎÊaccessÊý¾Ý¿âµÄ·½·¨Ó¦¸ÃÊÇʹÓÃDBI¿â
£º
require 'dbi'
DBI.connect("DBI:ADO:Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db.mdb;")
¿ÉÊÇ
¼òµ¥³¢ÊÔÖ®ºóûÄܳɹ¦£¬ÌáʾÕÒ²»µ½Çý¶¯Æ÷ADO,ÀÁµÃÔÙÊÔ£¬ËìÕÒÆäËû·½·¨¡£
Ò»·¬ËÑË÷Ö®ºó£¬·¢ÏÖ¿ÉÒÔÓÃWIN32OLEÀ´·ÃÎÊaccess,дһ¸ö¼òµ¥µÄÀà°ü×°Ö®:
......
¿ª·¢»·¾³
Ruby: Ruby1.9.1
Rails: Rails2.3.5
Mysql:Mysql5.0.9
Driver:mysql-2.8.1-x86-mingw32.gem
IDE:Rubymine2.0.1
Ò»¡¢´´½¨Êý¾Ý±íUsers
ÀûÓÃRubyMine×Ô´øµÄScaffold¹¤¾ß´´½¨Êý¾Ý±íUsers£¬Ò²¿ÉÒÔÊÖ¶¯´´½¨
¶þ¡¢´´½¨ControllerºÍView
RubyÏîÄ¿—>ÓÒ¼ü—>Create Model
Íê³Éºó½«×Ô¶¯Éú³ÉÏàÓ¦µÄÎ ......
¿ª·¢»·¾³
Ruby:Ruby1.9.1
Rails:Rails2.3.5
Mysql:Mysql5.0.9
Driver:mysql-2.8.1-x86-mingw32.gem
IDE:Rubymine2.0.1
Ò»¡¢´´½¨View/login
ÔÚView/loginÏ´´½¨login.html.erb¡¢index.html.erb¡¢loginFail.html.erb
login.html.erb´úÂëÈçÏ£º
<h1>Welcome to login!</h1>
<% form_tag do %>
& ......
Prepare
1. Download 'OCI 1.x.x.rb' (it's VERY important - execution MUST be *.rb)
2. Download 'oci8lib.so'
Install
1. Copy 'OCI8.rb' to .../ruby/lib/ruby/site_ruby/1.8/DBD/OCI8
2. Copy 'oci8.rb' to .../ruby/lib/ruby/site_ruby/1.8
3. Copy 'oci8lib.so' to .../ruby/lib/ruby/site_ruby/1.8/i386-msv ......
ÓÐÒ»¸öȫеÄÏîÄ¿£¬ÒòΪ¿¼Âǵ½½«À´µÄÊý¾ÝÀ©Õ¹ÐÔÄÜ£¬ËùÒÔ¿¼ÂÇÓÃCassandra×öÊý¾Ý´æ´¢£¬Ç°¶ËÓÃLighttpd + FastCGI + Rails¡£ÔÚʹÓÃCassandraµÄʱºò£¬¾õµÃÓÐһЩ¶«Î÷¿ÉÄÜ´ó¼Ò¶¼ÐèÒª£¬¾ÍдÁËÒ»¸ö¼òµ¥µÄÖ¸ÄÏ¡£ÒòΪÄÚÈݱȽϳ¤£¨16Ò³£©£¬¾ÍŪÁ˸öPDFÎļþ¸ø´ó¼ÒÏÂÔØ¡£
Cassandra in Action with Twitter's Ruby Client.pdf
Èç¹ûÏÂÔ ......