Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ruby°²×°mysql

ruby on rails°²×°mysqlÊý¾Ý¿â
1. ÏÂÔØmysqlÈí¼þ
  http://www.mysql.cn/
  mysqlÖÐÎĹٷ½ÍøÕ¾ÏÂÔØ°²×°Èí¼þ£¬Ñ¡Ôñ5.0
2. °²×°mysql£¬ÉèÖÃĬÈÏ×Ö·û¼¯Îªutf-8
3. ÏÂÔØmysql for rubyµÄÇý¶¯²¢°²×°
http://rubyforge.org/ËÑË÷mysql£¬ÕÒµ½mysql -win
µã»÷ÏÂÔØ£¬½øÈëÒ³Ãæ
http://rubyforge.org/frs/?group_id=1598&release_id=38245
ÏÂÔØmysql-2.7.1-mswin32.gem
c:\ruby Ŀ¼ÏÂÖ´ÐÐgem install  mysql-2.7.1-mswin32.gem
°²×°mysqlÁ¬½ÓrubyµÄÇý¶¯³ÌÐò
4. ÅäÖÃ
½«mysql°²×°Ä¿Â¼£¨Ä¬ÈÏC:\program files\mysql)Ö®binĿ¼ÏµÄlibmySQL.dll
¿½±´ÖÁC:\ruby\binĿ¼ÏÂ
½«C:\ruby\lib\ruby\gems\1.8\gems\mysql-2.7.1-mswin32\ext\Ŀ¼ÏÂmysql.soÎļþ
¿½±´ÖÁC:\ruby\lib\ruby\site_ruby\1.8\i386-msvcrt\Ŀ¼ÏÂ
5. ²âÊÔrubyÁ¬½Ómysql
test_mysql.rd:
    require "mysql"
   
    puts("hello,mysql")
ÃüÁîÐÐÖ´ÐÐruby test_mysql.rd
Êä³ö½á¹û£º
hello,mysql
6. mysqlÁ¬½Ó³É¹¦
  


Ïà¹ØÎĵµ£º

RUBY EXCEL²Ù×÷

 ÓÃrubyн¨Ò»¸öexcelÎļþ£¬²¢ÇÒÉèÖÃһЩֵ¡£
 require 'win32ole'
excel = WIN32OLE.new("excel.application")       
excel.Visible = true
excel.WorkBooks.Open("d:\\test.xls")
excel.WorkSheets("sheet1").Activate
excel.Cells(2,3).value = "ÕÅÈý"
exce ......

ubuntuÏ´ruby on rails

 Ò» °²×°ruby
$sudo apt-get install ruby irb rdoc
¶þ °²×°gem
1.µ½ÕâÀïÏÂÔØ ,×îºÃÊÇ×îа汾£¬ÎÒµÄ1.3.5
½âѹ£¬Çл»µ½µ±Ç°Ä¿Â¼£¬Ö´ÐÐ$sudo ruby setup.rb
»òÕßÕâÑù£º
$ tar xzvf rubygems-1.3.5.tgz   £¨½âѹ£©
$ cd rubygems-1.3.5     £¨Çл»µ½´ËĿ¼£©
$ sudo ruby setup ......

Ruby 1.9²»»áɱËÀPython

Ëɱ¾ÐкêÈçÔ¼ÓÚÊ¥µ®½Ú·¢²¼ÁËRuby 1.9¡£¸ù¾ÝRubyµÄ¹ßÀý£¬Ð¡ÊýµãºóÃæµÚһλÈç¹ûÊǵ¥Êý£¬ÄÇô¾Í±íÃ÷ÕâÊÇÒ»¸öʵÑé°æ±¾£¬²»ÍƼöÓÃÓÚ²úÆ·»·¾³¡£Ëùν“²úÆ·»·¾³”£¬¶ÔÓÚÄ¿Ç°µÄRubyÀ´Ëµ£¬»ù±¾ÉϾÍÊÇRuby on Rails¡£´ÓÄ¿Ç°RoRÉçȺµÄ·´Ó³À´¿´£¬È·ÊµÓÐÈËÕýÔÚ³¢ÊÔÓÃRuby 1.9ÅäºÏRoR£¬µ«ÊÇÉÐÊôÍæƱÐÔÖÊ¡£ÎÒѯÎÊÁËһЩ´¦ÔÚÕæÊµÏ ......

win»·¾³Ï±¾µØ°²×°ruby on rails

¹ý³ÌÈçÏ£º
1¡¢rubyÏÂÔØÒ»¼ü°²×°£º
http://rubyforge.org/frs/download.php/29263/ruby186-26.exe
ruby -v ÏÔʾ°æ±¾£¬°²×°³É¹¦
2¡¢ÏÂÔØrubygems°²×°£º
http://rubyforge.org/frs/download.php/60719/rubygems-1.3.5.zip
½âѹ£¬ruby setup.rb
gem -v  ÏÔʾ°æ±¾£¬°²×°³É¹¦
3¡¢ÏÂÔØrailsµÄ gem °²×°£¨gem install ......

c++Öе÷ÓÃruby´úÂë

#include < ruby.h > //
static int id_sum;
int Values[] = {5, 10 ,15,-1,20,0};
static VALUE wrap_sum(VALUE args)
{
 VALUE * values = (VALUE *) args;
 VALUE summer = values[0]; 
 VALUE max = values[1];
 return rb_funcall(summer,id_sum,1,max);
}
static VALUE ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ