view · edit · sidebar · attach · print · history

Day One

<< | Index | DayTwo >>

  • start reading at the bottom.

ODDB

 [Wed Jan 11 16:40:15 2012] [error] mod_ruby: /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': /home/user/.local/rubygems/lib/rockit/token.rb:138: invalid multibyte char (US-ASCII) (SyntaxError)

=> revert previous step (that is, emerge mod_ruby for ruby 1.8), then add to /etc/apache2/vhosts.d/01_oddb_vhost.conf:

 RubyAddPath /home/user/.local/rubygems/lib
 RubyAddPath /usr/local/lib/ruby/gems/1.9.1/gems/sbsm-1.0.3/lib

also put into /etc/env.d/99rubylib :

 RUBYLIB=/home/user/.local/rubygems/lib
  • apache error_log:
 [Wed Jan 11 15:39:59 2012] [notice] Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/1.0.0e mod_ruby/1.3.0 Ruby/1.8.7(2011-06-30) configured -- resuming normal operations
 [Wed Jan 11 15:39:59 2012] [error] mod_ruby: failed to require sbsm/trans_handler
 [Wed Jan 11 15:39:59 2012] [error] mod_ruby: error in ruby
 [Wed Jan 11 15:39:59 2012] [error] mod_ruby: ruby:0:in `require': no such file to load -- sbsm/trans_handler (LoadError)

=> 1) remove gentoo ruby1.8, compile git version of mod_ruby against /usr/local ruby1.9

   2) add 'RubyAddPath /home/user/.local/rubygems/lib' to /etc/vhosts.d/01_oddb_vhost.conf
  • add entry oddb.user.org to /etc/hosts, add the same vhost to /etc/apache2/vhosts.d/01_oddb_vhost.conf
  • setup apache / mod_ruby
 user@localhost:~$ sudo /etc/init.d/apache2 start
 * apache2 has detected an error in your setup:
 Warning: DocumentRoot [/home/masa/ywesee/oddb.org/doc] does not exist
 Syntax error on line 17 of /etc/apache2/vhosts.d/01_oddb_vhost.conf:
 Invalid command 'RubyAddPath', perhaps misspelled or defined by a module not included in the server configuration
 * ERROR: apache2 failed to start

=>

 add RUBY to APACHE2_OPTS in /etc/conf.d/apache2,
 replace /home/masa/ywesee with /var/www in /etc/apache2/vhosts.d/01_oddb_vhost.conf
  • marshal (csv/cell)
 init system
 /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.0.8/lib/odba/marshal.rb:15:in `load': undefined class/module CSV::Cell (ArgumentError)

=>

 user@localhost:/usr/local/lib/ruby/1.9.1$ curl 'http://dev.ywesee.com/uploads/att/csv.rb.patch.20111123.txt' | sudo patch -p 0
  • the hash error
 /usr/local/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)

=>

 curl 'http://dev.ywesee.com/uploads/att/columninfo.rb.patch.20111123.txt' | sudo patch -p 0
 # modify /usr/local/lib/ruby/gems/1.9.1/gems/dbi-0.4.5/lib/dbi/handles/statement.rb, line 329, to:
 # fetched_rows.push(row.dup)
 # (as per patch http://dev.ywesee.com/uploads/att/statement.rb.patch.20111125.txt)
 curl 'http://dev.ywesee.com/uploads/att/row.rb.patch.20111125.txt' | sudo patch -p 0
  • the git error
 /var/www/oddb.org/src/view/changelog.rb:27: warning: already initialized constant SORT_DEFAULT
 /var/www/oddb.org/src/view/drugs/resultlist.rb:23: warning: already initialized constant BACKGROUND_SUFFIX
 bin/oddbd:27:in `read': No such file or directory - /var/www/oddb.org/.git/ORIG_HEAD (Errno::ENOENT) from bin/oddbd:27:in `<module:ODDB>' from bin/oddbd:25:in `<main>'

=>

 user@localhost:/var/www/oddb.org$ cp .git/refs/heads/master .git/ORIG_HEAD
  • database socket permission errors:
 could not connect to server: Permission denied (DBI::OperationalError)
 Is the server running locally and accepting
 connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

=> add user to unix group 'postgres'

  • install mod_ruby compiled for ruby1.8
 $ su
 # mv /usr/local/ /usr/local_
 # emerge www-apache/mod_ruby
 # mv /usr/local_ /usr/local
  • setup and start apache
 sudo cp /etc/apache2/httpd.conf{,.bak}
 sudo cp httpd.conf /etc/apache2/httpd.conf
 sudo cp 01_oddb_vhost.conf /etc/apache2/vhosts.d 
 sudo /etc/init.d/apache2 start
 * apache2 has detected an error in your setup:
 apache2: Syntax error on line 39 of /etc/apache2/httpd.conf: ServerRoot must be a valid directory
 * ERROR: apache2 failed to start

=> modify httpd.conf for 32-bit gnu/linux

 ServerRoot "/usr/lib/apache2"
  • import database
 sudo -u postgres createdb -E UTF8 -T template0 oddb.org.ruby193
 su
 cd /var/lib/postgresql/8.4/data/
 mkdir sql
 cd sql
 cp ~/user/'22:00-postgresql_database-oddb.org.ruby193-backup.gz' .
 zcat '22:00-postgresql_database-oddb.org.ruby193-backup.gz' | psql -U postgres oddb.org.ruby193

gives an error

 localhost sql # zcat '22:00-postgresql_database-oddb.org.ruby193-backup.gz' | psql -U postgres oddb.org.ruby193
 SET
 SET
 SET
 SET
 SET
 CREATE LANGUAGE
 ERROR:  role "oddb" does not exist
 SET
 CREATE FUNCTION

=> create user 'oddb' and repeat (drop and create and zcat)

 echo 'create role oddb' | sudo psql -U postgres
  • trying to install postgresql 8.4 on gentoo
 localhost etc # emerge '=postgresql-server-8.4.10'
 Calculating dependencies... done!
 [ebuild  NS   ~] dev-db/postgresql-base-8.4.10 [9.1.1] USE="ldap nls pam readline ssl zlib -doc -kerberos -pg_legacytimestamp -threads" LINGUAS="-af -cs -de -en -es -fa -fr -hr -hu -it -ko -nb -pl -pt_BR -ro -ru -sk -sl -sv -tr -zh_CN -zh_TW" 
        [ebuild  N    ~] dev-db/postgresql-server-8.4.10  USE="nls pam xml -doc -perl -pg_legacytimestamp -python (-selinux) -tcl -uuid" LINGUAS="-af -cs -de -en -es -fa -fr -hr -hu -it -ko -nb -pl -pt_BR -ro -ru -sk -sl -sv -tr -zh_CN -zh_TW" 

 The following keyword changes are necessary to proceed:
 #required by dev-db/postgresql-server-8.4.10, required by =postgresql-server-8.4.10 (argument)
 >=dev-db/postgresql-base-8.4.10:8.4 ~x86
 #required by =postgresql-server-8.4.10 (argument)
 =dev-db/postgresql-server-8.4.10 ~x86

 NOTE: This --autounmask behavior can be disabled by setting
              EMERGE_DEFAULT_OPTS="--autounmask=n" in make.conf.

=> add to /etc/portage/package.keywords

 >=dev-db/postgresql-base-8.4.10:8.4 ~x86
 =dev-db/postgresql-server-8.4.10 ~x86

then run:

 sudo emerge '=postgresql-server-8.4.10'
 sudo emerge --config '=dev-db/postgresql-server-8.4.10'
 sudo /etc/init.d/postgresql-8.4 start
  • cattr_accessor error in paypal/Notification
 user@localhost:/var/www/oddb.org$ bin/oddbd
 /usr/local/lib/ruby/gems/1.9.1/gems/paypal-2.0.0/lib/notification.rb:52:in `<class:Notification>': undefined method `cattr_accessor' for Paypal::Notification:Class (NoMethodError)

=> add to /usr/local/lib/ruby/gems/1.9.1/gems/paypal-2.0.0/lib/notification.rb:

 require 'active_support/core_ext/class/attribute_accessors'
  • no html-parser
 user@localhost:/var/www/oddb.org$ bin/oddbd
 ...
 /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- html-parser (LoadError)

=>

 user@localhost:~/.local/rubygems/lib$
 wget http://trac.ywesee.com/raw-attachment/ticket/226/sgml-parser.rb
 wget http://trac.ywesee.com/raw-attachment/ticket/226/html-parser.rb
 wget http://trac.ywesee.com/raw-attachment/ticket/226/formatter.rb
  • encoding error:
 user@localhost:/var/www/oddb.org$ bin/oddbd
 ...
 /var/www/oddb.org/src/util/quanty/parse.rb:464:in `module_eval': parse.y:84: invalid multibyte char (US-ASCII) (SyntaxError)
        parse.y:84: invalid multibyte char (US-ASCII)
        parse.y:84: syntax error, unexpected $end, expecting keyword_then or ',' or ';' or '\n'
              when /\A[A-Za-z_µ]+([A-Za-z_µ0-9-]+[A-Za-z_µ])?/ou

=> add magic comment to:

 /var/www/oddb.org/src/util/quanty/parse.rb
 /var/www/oddb.org/src/util/quanty/fact.rb
 user@localhost:/var/www/oddb.org/data/quanty$ sudo make               
 ruby mkdump.rb lib/quanty/units.dump
 /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- lib/quanty/parse.rb (LoadError) from /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require' from mkdump.rb:1:in `<main>'         make: *** [lib/quanty/units.dump] Error 1

=> emerge ruby18 and rubygems, then

 user@localhost:/var/www/oddb.org/data/quanty$ ruby18 -rubygems extconf.rb
 user@localhost:/var/www/oddb.org/data/quanty$ sudo make install
  • quanty error:
 user@localhost:/var/www/oddb.org$ bin/oddbd
 /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': iconv will be deprecated in the future, use String#encode instead.
 /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- util/quanty (LoadError)

=>

 user@localhost:/var/www/oddb.org/data/quanty$ sudo ruby extconf.rb && echo ok
 extconf.rb:2: Use RbConfig instead of obsolete and deprecated Config.
 ok

=> still misses racc:

 user@localhost:/var/www/oddb.org/data/quanty$ sudo make
 racc -E -o lib/quanty/parse.rb parse.y
 make: racc: Command not found
 make: *** [lib/quanty/parse.rb] Error 127

=> sudo gem install racc

  • htmlgrid.so error:
 user@localhost:/var/www/oddb.org$ bin/oddbd 
 /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': iconv will be deprecated in the future, use String#encode instead.
        could not find htmlgrid.so, falling back to pure-ruby class

=>

 user@localhost:/usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.4/ext/htmlgrid$ sudo ruby extconf.rb
 creating Makefile
 user@localhost:/usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.4/ext/htmlgrid$ sudo make
 linking shared-object htmlgrid.so
  • Several gems (money -v '3.7.1', needle -v '1.3.0', paypal -v '2.0.0', polyglot -v '0.3.3') generate errors like this:
 ERROR:  While executing gem ... (ArgumentError)
 Illformed requirement ["1.0.4, 1.0.3"]

but re-running the script (with just these gems) seemed to work -- probably a more compatible version of a toolchain gem (like rake) was installed. So, moving these gems to the bottom of the script.

 ERROR:  Error installing dbd-pg: ERROR: Failed to build gem native extension.

 /usr/local/bin/ruby extconf.rb
 checking for pg_config... no
 No pg_config... trying anyway. If building fails, please try again with
 --with-pg-config=/path/to/pg_config
 checking for libpq-fe.h... no
 Can't find the 'libpq-fe.h header

=>

 emerge -s postgresql
 sudo emerge -av postgresql-server

 user@localhost:~$ sudo sh installgems.sh 
 /usr/local/lib/ruby/1.9.1/yaml.rb:56:in `<top (required)>':
 It seems your ruby installation is missing psych (for YAML output).
 To eliminate this warning, please install libyaml and reinstall your ruby.

=> emerge libayml and reinstall ruby from source into /usr/local

  • Use a simple emacs macro to convert the gem list into actual commands
  • Copy/paste list of gems into installgems.sh

Apache

  • user@localhost:~$ sudo emerge -av apache
view · edit · sidebar · attach · print · history
Page last modified on January 13, 2014, at 03:42 PM