yorobot/football.db

Rake Build fails due to missing log database

jokecamp opened this issue · 1 comments

I am new to ruby/rake but it looks like the logDb.Create is not being called soon enough.

I get the following error: ActiveRecord::StatementInvalid: Could not find table 'logs'

Stack trace:

$ rake build
before require 'sportdb'
activerecord-utils/0.2.0 (activerecord/4.1.1) on Ruby 2.1.0 (2013-12-25) [x86_64-darwin12.0]
confdb/1.1.1 on Ruby 2.1.0 (2013-12-25) [x86_64-darwin12.0]
tagutils/0.2.2 on Ruby 2.1.0 (2013-12-25) [x86_64-darwin12.0]
  [TagDb.has_many_tags] adding taggings n tags has_many assocs to model >WorldDb::Model::Country<
  [TagDb.has_many_tags] adding taggings n tags has_many assocs to model >WorldDb::Model::Region<
  [TagDb.has_many_tags] adding taggings n tags has_many assocs to model >WorldDb::Model::City<
worlddb/2.0.4 on Ruby 2.1.0 (2013-12-25) [x86_64-darwin12.0]
logdb 0.6.0 on Ruby 2.1.0 (2013-12-25) [x86_64-darwin12.0]
persondb/0.3.1 on Ruby 2.1.0 (2013-12-25) [x86_64-darwin12.0]
fetcher/0.4.3 on Ruby 2.1.0 (2013-12-25) [x86_64-darwin12.0]
sportdb/1.8.26 on Ruby 2.1.0 (2013-12-25) [x86_64-darwin12.0]
after require 'sportdb'
  using DATA_KEY >worldcup<
rm ./build/football.db
{:adapter=>"sqlite3", :database=>"./build/football.db"}
[warn] Rakefile - 2014-05-25 14:04:41 -0400
rake aborted!
ActiveRecord::StatementInvalid: Could not find table 'logs'
/Users/joekampschmidt/.rvm/gems/ruby-2.1.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:512:in `table_structure'
/Users/joekampschmidt/.rvm/gems/ruby-2.1.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:387:in `columns'
/Users/joekampschmidt/.rvm/gems/ruby-2.1.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/schema_cache.rb:93:in `block in prepare_default_proc'
/Users/joekampschmidt/.rvm/gems/ruby-2.1.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/schema_cache.rb:44:in `yield'
/Users/joekampschmidt/.rvm/gems/ruby-2.1.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/schema_cache.rb:44:in `columns'
/Users/joekampschmidt/.rvm/gems/ruby-2.1.0/gems/activerecord-4.1.1/lib/active_record/model_schema.rb:214:in `columns'
/Users/joekampschmidt/.rvm/gems/ruby-2.1.0/gems/activerecord-4.1.1/lib/active_record/model_schema.rb:223:in `columns_hash'
/Users/joekampschmidt/.rvm/gems/ruby-2.1.0/gems/activerecord-4.1.1/lib/active_record/inheritance.rb:180:in `subclass_from_attributes?'
/Users/joekampschmidt/.rvm/gems/ruby-2.1.0/gems/activerecord-4.1.1/lib/active_record/inheritance.rb:23:in `new'
/Users/joekampschmidt/.rvm/gems/ruby-2.1.0/gems/activerecord-4.1.1/lib/active_record/validations.rb:39:in `create!'
/Users/joekampschmidt/.rvm/gems/ruby-2.1.0/gems/logutils-0.6.0/lib/logutils/db.rb:44:in `write'
/Users/joekampschmidt/.rvm/gems/ruby-2.1.0/gems/logutils-0.6.0/lib/logutils/logger.rb:177:in `block in write'
/Users/joekampschmidt/.rvm/gems/ruby-2.1.0/gems/logutils-0.6.0/lib/logutils/logger.rb:177:in `each'
/Users/joekampschmidt/.rvm/gems/ruby-2.1.0/gems/logutils-0.6.0/lib/logutils/logger.rb:177:in `write'
/Users/joekampschmidt/.rvm/gems/ruby-2.1.0/gems/logutils-0.6.0/lib/logutils/logger.rb:158:in `warn'
/Users/joekampschmidt/Projects/openfootball/build/Rakefile:56:in `block in <top (required)>'
/Users/joekampschmidt/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `eval'
/Users/joekampschmidt/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => build => create => env
(See full trace by running task with --trace)

Thanks for reporting. Sorry, that's a fatal bug. Change in task :env

 ## log all warns, errors, fatals to db
 LogDb.setup
logger.warn "Rakefile - #{Time.now}"  # say hello; log to db (warn level min)  

remove the line - logger.warn ....
if it still not working comment out the next line too - LogDb.setup.

Will update the build script later today.Cheers.Please, post build errors to the mailing list/forum. Cheers.

Changing:

task :env => BUILD_DIR do
  ...
   ## log all warns, errors, fatals to db
   LogDb.setup
   logger.warn "Rakefile - #{Time.now}"  # say hello; log to db (warn level min)  
end