T
Tom Cloyd
Jamey,
After a very long wait, I'm finally diving into the Kirbybase gem.
My problem is that I'm trying to create a table, following very
carefully the example given in the quite nice documentation (!), and
it's not working for me, and I cannot see the problem. The code
(stripped to essentials):
def main
%w(rubygems logger kirbybase yaml).each{ |lib| require lib }
db = KirbyBase.newlocal, nil, nil, './', '.tbl', './', true) #
requests that table indexes be created NOT when table is r
ead in but when it is first referenced
# create tables
newsitems = db.create_table( :datestr, {ataType=>:String,
:Required=>true, :Index=>1})
# insert some data <= *interpreter never got to this*
newsitems.insert( '2008.03.25a', 'First Title', 'First URL', false,
'This is an extended summary of the news item.' )
newsitems.insert( '2008.03.25b', 'Second Title', 'Second URL',
false, 'This is another extended summary of the
news item.' )
end
This produced:
$ ruby kirbyaml.rb
/var/lib/gems/1.8/gems/KirbyBase-2.6/lib/kirbybase.rb:566:in
`create_table': Must have a field type for each field name (RuntimeError)
from kirbyaml.rb:31:in `main'
from kirbyaml.rb:42
Originally, I had several variables in the table, but reduced this to
one to try to find the error, and failed. I simply don't see it.
Reduced further, to this -
newsitems = db.create_table( :datestr, :String )
the same error is produced.
Can anyone give me a clue as to the problem?
Thanks,
Tom
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tom Cloyd
Bellingham, Washington, U.S.A: (360) 920-1226
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
After a very long wait, I'm finally diving into the Kirbybase gem.
My problem is that I'm trying to create a table, following very
carefully the example given in the quite nice documentation (!), and
it's not working for me, and I cannot see the problem. The code
(stripped to essentials):
def main
%w(rubygems logger kirbybase yaml).each{ |lib| require lib }
db = KirbyBase.newlocal, nil, nil, './', '.tbl', './', true) #
requests that table indexes be created NOT when table is r
ead in but when it is first referenced
# create tables
newsitems = db.create_table( :datestr, {ataType=>:String,
:Required=>true, :Index=>1})
# insert some data <= *interpreter never got to this*
newsitems.insert( '2008.03.25a', 'First Title', 'First URL', false,
'This is an extended summary of the news item.' )
newsitems.insert( '2008.03.25b', 'Second Title', 'Second URL',
false, 'This is another extended summary of the
news item.' )
end
This produced:
$ ruby kirbyaml.rb
/var/lib/gems/1.8/gems/KirbyBase-2.6/lib/kirbybase.rb:566:in
`create_table': Must have a field type for each field name (RuntimeError)
from kirbyaml.rb:31:in `main'
from kirbyaml.rb:42
Originally, I had several variables in the table, but reduced this to
one to try to find the error, and failed. I simply don't see it.
Reduced further, to this -
newsitems = db.create_table( :datestr, :String )
the same error is produced.
Can anyone give me a clue as to the problem?
Thanks,
Tom
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tom Cloyd
Bellingham, Washington, U.S.A: (360) 920-1226
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~