易截截图软件、单文件、免安装、纯绿色、仅160KB

Install Cassandra with Ruby 1.9.1 on Windows

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.
  To me, I simply want to keep Cassandra independent from Ruby stuff, to ease the upgrade and administration.
  Refer to my blog "Setup Cassandra on Windows"
  (http://blog.csdn.net/goodxp/archive/2010/02/26/5327732.aspx) for details.
Step 2: Install Thrift (0.2.0)
  If you do "gem install cassandra", it should install thrift automatically (being a dependency).
  However, there is a compatibility issue on thrift with Ruby 1.9, so to fail Cassandra gem installation.
  It will be better to install thrift first and fix it before installing cassandra gem.
  Refer to my blog "fix thrift 0.2.0 installation with ruby 1.9.1"
  (http://blog.csdn.net/goodxp/archive/2010/02/28/5333145.aspx) for details.
 
Step 3: Install gem Cassandra
  This part is easy:
 
  $ gem install cassandra
  Do NOT do this: "$ cassandra_helper cassandra". It does not work.
  I did not dig deeper since I already have a working up-to-date version of Cassandra 0.5.0 installed.
  Switch to Cassandra bin folder and start cassandra server:
  $ cassandra -f
 
  Open another command console window:
 
  $ irb
  irb> require 'rubygems'
  irb> require 'cassandra'
 
  If you see a warning pop-up window asking for "msvcrt-ruby18.dll", do this:
 
  irb> quit
  $ gem uninstall json
 
  Don't worry, Ruby 1.9 has a good json support.
  Now run irb again as above, and then:
 
  irb> include Cassandra::Constants
  irb> db = Cassandra.new 'Keyspace1'
 


相关文档:

Ruby的装饰器模式实现

class Tree
def initialize
puts "Make a normal tree"
end
def decorate
puts "Make sure the tree won\'t fall"
end
end
class RedBalls < Tree
def initialize(tree)
@parent = tree;
end
def decorate
@parent.decorate
puts "Put on some red balls"
end
end ......

升级到snow leopard后ruby的问题

1. ruby已成为1.87 2. 必须先安装安装光盘里的新的xcode,在"optional"目录里 3. 可能需要重新安装macport http://trac.macports.org/wiki/Migration 4. 或者升级macport http://weblog.rubyonrails.org/2009/8/30/upgrading-to-snow-leopard $ sudo port selfupdate
$ sudo port sync
$ sudo port upgrade --force insta ......

交互式 Ruby Shell irb

irb 是从命令行运行的
irb 的命令行选项(摘自 Porgramming Ruby 第二版)
-f
禁止读取~/.irbrc Suppress reading ~/.irbrc.
-m
数学模式(支持分数和矩阵) Math mode (fraction and matrix support is available).
-d
设置#DEBUG为true(同ruby -d一样)  Set $DEBUG to true (same as ``ruby -d'').
-r lo ......

linux(ubuntu)下ruby开发环境搭建

env setup
linux(ubuntu)下ruby开发环境搭建,包括一些常见问题解决
注意,本文只是我在搭建ruby学习环境时的一些笔记,因为是用gedit编辑的,所以格式化不是很好,另外,只是备忘而已。
2010.1.19
1. install ruby
$ tar xzf ruby-1.8.7-p248.tar.gz
$ mv ruby-1.8.7-p248 ruby187
$ cd ruby187/
$ ./configure ......

win环境下本地安装ruby on rails

文章转自 http://www.ej38.com/showinfo/Ruby-140367.html 
过程如下:
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
g ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号