[Nitro] Hmm, what have I done wrong?
Michael Fellinger
manveru at valaraan.de
Sat Sep 10 15:09:48 EDT 2005
David Legard wrote:
> I'm very keen to start using Og, as it is perfect for some
> developments I'm working on, but I can't get to first base.
>
> I installed as a gem, ensured I have ruby-mysql installed, cribbed
> some code from the examples, updated (I believe) to the latest syntax.
>
> However, on trying to run this, I get an immediate segfault on the
> ' db = Og.setup(' line.
>
> Does anyone have an idea of what I'm doing wrong? Sorry if this is a
> dumb request.
>
>
> require 'rubygems'
> require_gem 'og'
>
> class Category
> property :name, String
> end
>
> class Post
> property :title, String
> property :body, String
> property :author, String
> property :create_time, Time
> property :hits, Fixnum
> end
>
> class Comment
> property :title, String
> property :body, String
> property :author, String
> property :create_time, Time
> end
>
> db = Og.setup(
> :destroy => false, # destroy table created from earlier runs.
> :database => 'test',
> :store => 'mysql',
> :user => "myself",
> :password => "mypassword"
> )
>
although it would help to know what the exact error was, i think you
have to write it like this
db = Og.setup(
:destroy => false # or just leave this outcommented till you
need it
:store => :mysql # this cannot be 'mysql' it must be a symbol
:name => 'test' # No :database - i have no idea where you
have got these defaults from
:user => 'mysqlf' # stays the same
:password => 'mypassword' #should give you no problems too...
)
hope i could help :)
still have to finish that part of the docu, but i'll do it asap...
so long...
manveru
More information about the Nitro-general
mailing list