[Nitro] Newbie question

Aureliano Calvo aurelianocalvo at yahoo.com.ar
Sat Apr 1 09:49:54 EST 2006


Hi!

I'm trying to do my first OG model. The source code is
below:

require 'og'

database = Og.setup(
  :name => 'test_og',
  :store => :sqlite
)

$DBG = true

class Movement
  property :cash, Fixnum
  property :description, String
end

m = Movement.new
m.cash = 5
m.description = "Sarasa"
m.save

When I run it, the following error ocurrs:
I, [2006-04-01T11:44:54.893000 #3840]  INFO -- : Og
uses the Sqlite store.
C:/ruby/lib/ruby/gems/1.8/gems/og-0.29.0/lib/og/entity.rb:477:in
`method_missing': undefined method `ogmanager' for
Movement:Class (NoMethodError)
	from
C:/ruby/lib/ruby/gems/1.8/gems/og-0.29.0/lib/og/entity.rb:32:in
`save'
	from C:/Documents and
Settings/Aure/workspace/test_og/populate.rb:21

I've installed og using gems:

> gem install og --include-dependencies

Attempting local installation of 'og'
Local gem file not found: og*.gem
Attempting remote installation of 'og'
Updating Gem source index for:
http://gems.rubyforge.org
Successfully installed og-0.29.0
Successfully installed glue-0.29.0
Successfully installed facets-1.0.3
Installing RDoc documentation for og-0.29.0...
Installing RDoc documentation for glue-0.29.0...

I'm running Ruby 1.8.2. under Windows XP using sqlite3
as the back-store. I've already connected to a sqlite3
database (i.e. a file) from non OG ruby code usign
sqlite3-ruby.

Can you tell me how can I correct my first try on OG?

Thanks in advance,
Aureliano.

__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar



More information about the Nitro-general mailing list