view · edit · sidebar · attach · print · history

Start ramaze.ch.oddb.org

 cd /var/www/ramaze.ch.oddb.org
 ruby1.9 start.rb

you need

 http://scm.ywesee.com/?p=oddb/.git;a=summary

Install the gems

activesupport (2.3.2)
bson (1.0.4)
dbd-pg (0.3.9)
dbi (0.4.5, 0.4.1)
deprecated (3.0.0, 2.0.1)
facets (1.8.54)
gd2 (1.1.1)
innate (2010.07)
minitest (1.6.0)
pg (0.10.1, 0.8.0)
rack (1.2.1)
ramaze (2010.06.18)
rdoc (2.5.9, 2.5.8)
rmagick (2.13.1)
turing (0.0.11)

Create the database

 su - postgres
 createdb -E UTF8 ch_oddb_org

Install the Database for Postgres 8.4

 zcat 22\:00-postgresql_database-ch_oddb_org-backup.gz | psql -U postgres ch_oddb_org

New error comes

 /usr/lib/ruby/gems/1.9.1/gems/dbi-0.4.5/lib/dbi/columninfo.rb:49:in `[]=': 
 can't add a new key into hash during iteration (RuntimeError)
        from /usr/lib/ruby/gems/1.9.1/gems/dbi-0.4.5/lib/dbi/columninfo.rb:49:in `block in initialize'
        from /usr/lib/ruby/gems/1.9.1/gems/dbi-0.4.5/lib/dbi/columninfo.rb:42:in `each_key'
        from /usr/lib/ruby/gems/1.9.1/gems/dbi-0.4.5/lib/dbi/columninfo.rb:42:in `initialize'
        from /usr/lib/ruby/gems/1.9.1/gems/dbi-0.4.5/lib/dbi/handles/database.rb:161:in `new'
        from /usr/lib/ruby/gems/1.9.1/gems/dbi-0.4.5/lib/dbi/handles/database.rb:161:in `block in columns'
        from /usr/lib/ruby/gems/1.9.1/gems/dbi-0.4.5/lib/dbi/handles/database.rb:161:in `collect'
        from /usr/lib/ruby/gems/1.9.1/gems/dbi-0.4.5/lib/dbi/handles/database.rb:161:in `columns'
        from /usr/lib/ruby/site_ruby/1.9.1/odba/connection_pool.rb:36:in `block in method_missing'
        from /usr/lib/ruby/site_ruby/1.9.1/odba/connection_pool.rb:26:in `next_connection'
        from /usr/lib/ruby/site_ruby/1.9.1/odba/connection_pool.rb:35:in `method_missing'
        from /usr/lib/ruby/site_ruby/1.9.1/odba/storage.rb:525:in `setup'
        from /usr/lib/ruby/site_ruby/1.9.1/odba/cache.rb:433:in `setup'
        from /usr/lib/ruby/site_ruby/1.9.1/oddb/persistence/odba.rb:35:in `<module:ODDB>'
        from /usr/lib/ruby/site_ruby/1.9.1/oddb/persistence/odba.rb:28:in `<top (required)>'
        from /var/www/ramaze.ch.oddb.org/model/init.rb:3:in `require'
        from /var/www/ramaze.ch.oddb.org/model/init.rb:3:in `<top (required)>'
        from /var/www/ramaze.ch.oddb.org/app.rb:32:in `require'
        from /var/www/ramaze.ch.oddb.org/app.rb:32:in `<top (required)>'
        from start.rb:7:in `require'
        from start.rb:7:in `<main>'

Change the lines (thanks to Chuck Remes for the hint!)

 - h.each_key do |k|
 + h.keys.each do |k| 

And a new error comes

 C:/Ruby192/lib/ruby/gems/1.9.1/gems/dbd-pg-0.3.9/lib/dbd/pg/statement.rb:62:in `rescue in execute': FEHLER:  Relation ┬╗oddb_business_company_name┬ existiert bereits 
 (DBI::ProgrammingError)
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/dbd-pg-0.3.9/lib/dbd/pg/statement.rb:37:in `execute'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/dbi-0.4.2/lib/dbi/base_classes/database.rb:96:in `execute'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/dbi-0.4.2/lib/dbi/base_classes/database.rb:114:in `do'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/dbi-0.4.2/lib/dbi/handles/database.rb:106:in `do'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/storage.rb:176:in `create_index'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/index.rb:226:in `initialize'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/cache.rb:148:in `new'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/cache.rb:148:in `block in create_index'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/storage.rb:558:in `call'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/storage.rb:558:in `block in transaction'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/dbi-0.4.2/lib/dbi/handles/database.rb:209:in `transaction'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/connection_pool.rb:36:in `block in method_missing'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/connection_pool.rb:26:in `next_connection'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/connection_pool.rb:35:in `method_missing'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/storage.rb:554:in `transaction'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/cache.rb:520:in `transaction'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/cache.rb:140:in `create_index'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/cache.rb:131:in `block in create_deferred_indices'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/cache.rb:125:in `each'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/cache.rb:125:in `create_deferred_indices'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/cache.rb:437:in `setup'
        from C:/Ruby192/lib/ruby/site_ruby/1.9.1/oddb/persistence/odba.rb:35:in `<module:ODDB>'
        from C:/Ruby192/lib/ruby/site_ruby/1.9.1/oddb/persistence/odba.rb:28:in `<top (required)>'
        from <internal:lib/rubygems/custom_require>:29:in `require'
        from <internal:lib/rubygems/custom_require>:29:in `require'
        from C:/Users/zdavatz/ramaze.ch.oddb.org/model/init.rb:3:in `<top (required)>'
        from <internal:lib/rubygems/custom_require>:29:in `require'
        from <internal:lib/rubygems/custom_require>:29:in `require'
        from C:/Users/zdavatz/ramaze.ch.oddb.org/app.rb:32:in `<top (required)>'
        from <internal:lib/rubygems/custom_require>:29:in `require'
        from <internal:lib/rubygems/custom_require>:29:in `require'
        from start.rb:7:in `<main>'

Force the Array - works for Ruby 1.9.1 and Ruby 1.9.2

So in

 /usr/lib/ruby/gems/1.9.1/gems/dbi-0.4.5/lib/dbi/handles/statement.rb

we changed

 #fetched_rows.push(row)

to

 fetched_rows.push(row.to_a)

and it works! But we do not yet understand why it works for Ruby 1.9.2 - now I get a new error:

 NoMethodError: undefined method `country' for #<RCLConf::RCLConf:0x3498660>
view · edit · sidebar · attach · print · history
Page last modified on January 25, 2011, at 09:48 AM