ruby
文章平均质量分 69
JophyYao
一个各方面成熟中的coder, 在这里记录成长的点滴。
展开
-
ruby 操作MongoDB
想要在Ruby中连接MongoDB,需要使用mongo模块,该模块可以通过ruby自带的gems程序进行安装。 gem update --system gem install mongo gem install bson_ext 简单的例子: require 'mongo' db = Mongo::Connection.new("localhost", 2701原创 2012-11-24 11:16:07 · 750 阅读 · 0 评论 -
ruby gem常用命令
ruby -v #查看ruby 版本 ruby -e ''require"watir"; puts Watir::IE::VERSION'' #查看watir版本 gem -v原创 2012-11-24 11:19:53 · 488 阅读 · 0 评论 -
ruby DBI模块
1.安装 gem install dbi gem install dbd-mysql 手动安装 http://blog.csdn.net/ruby_cn/article/details/174293 http://rubyforge.org/projects/ruby-dbi/ 下载ruby-dbi tar zxf dbi-0.1.1.tar.gz ruby setup.rb co原创 2012-11-24 11:26:31 · 772 阅读 · 0 评论 -
ruby 使用mysql API
1.安装mysql驱动 gem install mysql irb irb(main):001:0> require 'mysql' //测试安装 2.使用 require 'mysql' begin puts "connect to mysql database" dbh = Mysql.real_connect("localhost", "root", "root",原创 2012-11-24 11:57:21 · 411 阅读 · 0 评论 -
linux build ruby on rails
1. Install ruby parser Ruby official website: http://www.ruby-lang.org/en/downloads/download to the linux server, thentar zxvf ruby-1.9.3-p194.tar.gz cd ruby-1.9.3-p194 ./configure –prefix=/usr/lo原创 2012-11-25 20:30:33 · 317 阅读 · 0 评论 -
Rails3 Route 用法集锦
默认路由: Ruby代码 # Rails3: match '/:controller(/:action(/:id))' # Rails2: map.connect ':controller/:action/:id' # Rails3: match '/:controller(/:action(/:id))' # Rails2: map.connect ':controller/:ac原创 2012-11-25 20:33:28 · 403 阅读 · 0 评论 -
ruby on rails3 study notes
use rails 3.2.5 version build project: rails new {project_name} -d mysql running rails server: script/rails server -p 80 the first form: add route in config/routes.rb root :to => "posts#new" //原创 2012-11-25 20:39:20 · 350 阅读 · 0 评论