How to install redis with Ruby

原文
http://snippets.aktagon.com/snippets/320-How-to-install-and-use-Redis-with-Ruby



   1  git clone git://github.com/ezmobius/redis-rb.git
   2  cd redis-rb/
   3  rake redis:install
   4  rake dtach:install
   5  rake redis:start &
   6  rake install
   7  
   8  cat <<EOF >>test.rb
   9  require 'rubygems'
  10  require 'redis'
  11  
  12  r = Redis.new
  13  
  14  r.delete('foo')
  15  
  16  p'set foo to "bar"'
  17  r['foo'] = 'bar'
  18  
  19  p 'value of foo'
  20  p r['foo']
  21  EOF
  22  
  23  ruby test.rb

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章