Here is a simple example to get you started.
Prerequisites
- Install Riak via Homebrew (brew install riak)
- Install Ruby 1.9.2 via RVM (rvm install 1.9.2-rc2)
- Rails3 via RubyGems (gem install rails --pre)
Version Disclosure
This is what I'm using. Things change, and YMMV.
- Ruby 1.9.2 RC2
- Rails 3 Beta 4
- Ripple edge (cb087f6)
- Riak 0.12.0 on Erlang R13B04
Step By Step
- > rails new myapp
- > cd myapp
- Edit Gemfile like so:
source 'http://rubygems.org'
gem 'rails', '3.0.0.beta4'
gem 'ripple', :git => 'http://github.com/seancribbs/ripple.git'
gem 'curb'
- > bundle install
- Edit config/database.yml like so:
ripple:
development:
port: 8098
host: localhost
- Create app/models/post.rb:
require 'ripple'
class Post
include Ripple::Document
property :title, String, :presence => true
property :body, String
end
- > riak start
- > rails console
Have Fun!

0 comments:
Post a Comment