view · edit · sidebar · attach · print · history

Getting ch.oddb.org ready as a gem package.

<< | Index | ChoddbWindows >>

Files modified so far

  • gem install oddb.org
  • gem install quanty-1.1 (Version 1.2 will work as well with the modifications)
  • modify
 /usr/lib/ruby/gems/1.8/gems/oddb.org-1.0.0/src/model/dose.rb

from

 require 'util/quanty'

to

 require 'rubygems'
 require 'quanty'
  • modify
 /usr/lib/ruby/gems/1.8/gems/oddb.org-1.0.0/data/quanty/lib/quanty.rb

from

 require 'util/quanty/parse'
 require 'util/quanty/fact'
 require 'util/quanty/main'

to

 require 'rubygems'
 require 'parse'
 require 'fact'
 require 'main'
  • modify /usr/lib/ruby/gems/1.8/gems/quanty-1.1.0/lib/quanty.rb

from

 require 'util/quanty/parse'
 require 'util/quanty/fact'
 require 'util/quanty/main'

to

 require 'rubygems'
 require 'quanty/parse'
 require 'quanty/fact'
 require 'quanty/main'
  • it seems that
  ls /var/www/oddb.org/src/util/quanty

has these files

 fact.rb  main.rb  parse.rb  units.dump

but

 ls /usr/lib/ruby/gems/1.8/gems/quanty-1.1.0/lib/quanty/

misses

 units.dump

that must create the following error

 /usr/lib/ruby/gems/1.8/gems/quanty-1.1.0/lib/quanty/fact.rb:80:in `decomp': `radian': unknown unit (RuntimeError)
        from /usr/lib/ruby/gems/1.8/gems/quanty-1.1.0/lib/quanty/fact.rb:30:in `initialize'
        from /usr/lib/ruby/gems/1.8/gems/quanty-1.1.0/lib/quanty/main.rb:18:in `new'
        from /usr/lib/ruby/gems/1.8/gems/quanty-1.1.0/lib/quanty/main.rb:18
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from /usr/lib/ruby/gems/1.8/gems/quanty-1.1.0/lib/quanty.rb:4
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
         ... 35 levels...
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from /usr/lib/ruby/gems/1.8/gems/oddb.org-1.0.0/bin/oddbd:9
        from /usr/bin/oddbd:19:in `load'
        from /usr/bin/oddbd:19

this helped

 sudo cp /var/www/oddb.org/src/util/quanty/units.dump /usr/lib/ruby/gems/1.8/gems/quanty-1.1.0/lib/quanty/

running

 oddbd

again results in next error

 /usr/lib/ruby/gems/1.8/gems/oddb.org-1.0.0/src/view/changelog.rb:26: warning: already initialized constant SORT_DEFAULT
 /usr/lib/ruby/1.8/fileutils.rb:243:in `mkdir': Permission denied - /usr/lib/ruby/gems/1.8/gems/oddb.org-1.0.0/data/downloads  (Errno::EACCES)
        from /usr/lib/ruby/1.8/fileutils.rb:243:in `fu_mkdir'
        from /usr/lib/ruby/1.8/fileutils.rb:217:in `mkdir_p'
        from /usr/lib/ruby/1.8/fileutils.rb:215:in `reverse_each'
        from /usr/lib/ruby/1.8/fileutils.rb:215:in `mkdir_p'
        from /usr/lib/ruby/1.8/fileutils.rb:201:in `each'
        from /usr/lib/ruby/1.8/fileutils.rb:201:in `mkdir_p'
        from /usr/lib/ruby/gems/1.8/gems/oddb.org-1.0.0/src/util/exporter.rb:23
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
         ... 30 levels...
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from /usr/lib/ruby/gems/1.8/gems/oddb.org-1.0.0/bin/oddbd:9
        from /usr/bin/oddbd:19:in `load'
        from /usr/bin/oddbd:19

now

 sudo oddbd

results in

 /usr/lib/ruby/gems/1.8/gems/oddb.org-1.0.0/src/view/changelog.rb:26: warning: already initialized constant SORT_DEFAULT
 /usr/lib/ruby/gems/1.8/gems/oddb.org-1.0.0/src/view/drugs/resultlist.rb:21: warning: already initialized constant BACKGROUND_SUFFIX
 /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- etc/db_connection (MissingSourceFile)
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.10/lib/active_support/dependencies.rb:182:in `require'
        from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.10/lib/active_support/dependencies.rb:547:in `new_constants_in'
        from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.10/lib/active_support/dependencies.rb:182:in `require'
        from /usr/lib/ruby/gems/1.8/gems/oddb.org-1.0.0/bin/oddbd:10
        from /usr/bin/oddbd:19:in `load'
        from /usr/bin/oddbd:19

this I understand but how do I get the file into the right position? This directory

 /usr/lib/ruby/gems/1.8/gems/oddb.org-1.0.0/etc>

shows me

 index_definitions.yaml  trans_handler.yml

so I do

 sudo cp /var/www/oddb.org/etc/db_connection.rb /usr/lib/ruby/gems/1.8/gems/oddb.org-1.0.0/etc/

again

 sudo oddbd

that results in

 /usr/lib/ruby/gems/1.8/gems/oddb.org-1.0.0/src/view/changelog.rb:26: warning: already initialized constant SORT_DEFAULT
 /usr/lib/ruby/gems/1.8/gems/oddb.org-1.0.0/src/view/drugs/resultlist.rb:21: warning: already initialized constant BACKGROUND_SUFFIX
 /usr/lib/ruby/gems/1.8/gems/oddb.org-1.0.0/bin/oddbd:27:in `read': No such file or directory - /usr/lib/ruby/gems/1.8/gems/oddb.org-1.0.0/.git/ORIG_HEAD (Errno::ENOENT)
        from /usr/lib/ruby/gems/1.8/gems/oddb.org-1.0.0/bin/oddbd:27
        from /usr/bin/oddbd:19:in `load'
        from /usr/bin/oddbd:19

this file

 /home/zeno/.software/oddb.org/bin

has this in it,

 module ODDB
        headpath = File.expand_path('../.git/ORIG_HEAD', File.dirname(__FILE__))
        ODDB_VERSION = File.read(headpath)
 end

so the error must come from that file (indirectly because I installed oddbd via Rubygems). Why is a dependeny on .git in the original source code? It is also mentioned in the INSTALL_from_source.txt under point 14.

So in this case I have to do

 sudo cp /home/zeno/.software/oddb.org/.git/refs/heads/master /usr/lib/ruby/gems/1.8/gems/oddb.org-1.0.0/.git/ORIG_HEAD

ok nice, the gem starts up and results in

 init system
 init system: 4.937799
 setup drb-delegation
 reset
 next random update will take place at Wed Dec 22 15:19:00 +0100 2010
 reset: 4.953538
 system initialized
 initialized: 4.95363
 Errno::ENOENT
 No such file or directory - /usr/lib/ruby/gems/1.8/gems/oddb.org-1.0.0/doc/resources/downloads/status

so I am gonna create the directories

 doc/resources/downloads

Nice it starts up

 init system
 init system: 5.036065
 setup drb-delegation
 reset
 next random update will take place at Thu Dec 23 05:10:00 +0100 2010
 reset: 5.050752
 system initialized
 initialized: 5.05084
view · edit · sidebar · attach · print · history
Page last modified on December 22, 2010, at 04:19 PM