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'
 
Ïà¹ØÎĵµ£º
ÔÚÂÛ̳Àï¿´ÁËdaquan198163ËùдµÄ¡¶³õѧRORµÄÒÉ»ó¡·ÕâƪÎÄÕ£¬robbinÔڻظ´ÖиøÁËÏêϸµÄ½â´ð£¬¿ÉÊÇ¿´Íê½â´ðÖ®ºó£¬ÎÒÒ²²úÉúÁËһЩÒÉ»ó£¬ÔÚ´ËÏëÎÊÎÊ¡£
ÔÚrobbinËù¸ø³öµÄ½â´ðµ±ÖУ¬¸ü¶àµÄÊDzûÊörailsµÄºÃ´¦£¬È»¶ø´ó¼Ò¶¼ÖªµÀ£¬railsÖ»Ê ......
ÕÕÀý¿ÉÒÔÏÈ¿´¶Ë³ÌÐò
class Person
def initialize( name,age=18 )
@name = name
@age = age
@motherland = "China"
end
def talk
puts "my name is "+@name+", age is "+@age.to_s
&n ......
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½âÊÍÆ÷ʱ£¬Äã²»½ö¿ÉÒÔÌṩ³ÌÐòÎļþµÄÃû×Ö£¬¶øÇÒ¿ÉÒÔÌṩһ¸ö»ò¶à¸öÃüÁîÐпª¹Ø¡£ÄãÑ¡ÔñµÄ¿ª¹Øָʾ½âÊÍÆ÷ÒÔÒ»ÖÖÌض¨µÄ·½Ê½ÔËת£¬²¢ÇÒ/»òÕßÖ´ÐÐÌض¨µÄ²Ù×÷¡£
RubyÃüÁîÐпª¹ØÓÐ20¶à¸ö£¬ÆäÖÐÓÐЩºÜÉÙʹÓã¬ÓÐЩÔòÿÌì±»ºÜ¶àRuby³ÌÐòԱʹÓá£ÔÚÕâÀïÎÒÃǽ«ÔÙ¿´¼¸¸ö×î³£Óõġ££¨ÄãÒѾ¿´µ½¹ýÆäÖеÄÁ½¸ö£¬-cºÍ&ndas ......
ΪÁËÑ¡ÔñÒ»¸öºÏÊʵĽű¾ÓïÑÔѧϰ£¬½ñÌì²éÁ˲»ÉÙÓйØPerl£¬Python£¬Ruby£¬JavascriptµÄ¶«Î÷£¬¿ÉÊÇ·¢ÏÖ¸÷´óÕóÓªµÄÈ˶¼ÔÚ´µÅõ×Ô¼ºÏ²»¶µÄÓïÑÔ£¬²»¹ý×îûÓÐÕùÒéµÄÓ¦¸ÃÊÇJavascriptÏֽ׶λ¹²»ÊʺÏÓÃÀ´×ö¶ÀÁ¢¿ª·¢£¬ËüµÄÌìÏ»¹ÊÇÔÚwebÓ¦ÓÃÉÏ¡£ ÎÒÖ÷ÒªÊÇÏë×öÊý¾ÝÍÚ¾òËã·¨µÄÑо¿£¬Ó¦¸Ã»á´¦Àí´óÁ¿µÄÎı¾¡£Ìáµ½Îı¾´¦Àí£¬ÏàÐŴ󲿷ÖÈË ......