Must find the proper way on howto start a HTTP-server (Hannes used webrick) and connect it to ydim (flexmock) server.
This is tricky. Therefore trying, whether my changes work on oddb-ci2 in the real setup.
Pushed some minor cleanups:
Now starting ydim using sudo -u apache /usr/local/bin/ruby230 /home/niklaus/git/ydim/bin/ydimd
To ensure that my bundles get started correctly I used the following steps
cd/home/niklaus/git/ruby-dbi && /usr/local/bin/gem230 build dbi.gemspec && sudo /usr/local/bin/gem230 install pkg/dbi-0.4.6.gem
cd/home/niklaus/git/sbsm && /usr/local/bin/gem230 build sbsm.gemspec && sudo /usr/local/bin/gem230 install sbsm-1.2.5.gem
cd/home/niklaus/git/htmlgrid && /usr/local/bin/gem230 build htmlgrid.gemspec && sudo /usr/local/bin/gem230 install htmlgrid-1.0.8.gem
cd/home/niklaus/git/ydim && /usr/local/bin/gem230 build ydim.gemspec && sudo /usr/local/bin/gem230 install *.gem
git checkout https://github.com/ngiger/ydim-html.git /var/www/ydim.ywesee.com
cd /var/www/ydim.ywesee.com
sudo -u apache /usr/local/bin/bundle install --system
sudo -u apache /usr/local/bin/bundle exec bin/ydim-htmld config=/etc/ydim/ydimd.yml
When looking at all the dependent gems I see, that we still use rmail in ydim, whereas we have moved to mail everywhere else. But as there are newer version of rmail which support Ruby 2.x I will leave it for the moment being.
When I start it, I get now a (probably very significant error)
niklaus@oddb-ci2 /v/w/ydim.ywesee.com> sudo -u apache /usr/local/bin/ruby230 bin/ydim-htmld config=/etc/ydim/ydimd.yml /usr/local/lib/ruby/gems/2.3.0/gems/needle-1.3.0/lib/needle/definition-context.rb:36: warning: undefining `initialize' may cause serious problems /usr/local/lib/ruby/gems/2.3.0/gems/needle-1.3.0/lib/needle/definition-context.rb:36: warning: undefining `object_id' may cause serious problems /usr/local/lib/ruby/gems/2.3.0/gems/needle-1.3.0/lib/needle/definition-context.rb:36: warning: undefining `__send__' may cause serious problems /usr/local/lib/ruby/site_ruby/2.3.0/x86_64-linux/ydim/server.rb:65: warning: already initialized constant YDIM::Server::CONFIG /usr/local/lib/ruby/gems/2.3.0/gems/ydim-1.0.1/lib/ydim/server.rb:65: warning: previous definition of CONFIG was here /usr/local/lib/ruby/site_ruby/2.3.0/x86_64-linux/ydim/server.rb:66: warning: already initialized constant YDIM::Server::SECONDS_IN_DAY /usr/local/lib/ruby/gems/2.3.0/gems/ydim-1.0.1/lib/ydim/server.rb:66: warning: previous definition of SECONDS_IN_DAY was here /usr/local/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- iconv (LoadError) from /usr/local/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require' from /usr/local/lib/ruby/gems/2.3.0/gems/htmlgrid-1.0.8/lib/htmlgrid/component.rb:29:in `<top (required)>'
Grepping to iconv shows, that is is used in directly somewhere in ext/htmlgrid. The last few commits were
git log -2 ext commit 4b8fc8de457647705f277cd001680bc3517d3de9 Author: Masaomi Hatakeyama <mhatakeyama@ywesee.com> Date: Fri Dec 23 18:01:33 2011 +0100 patch grid.c for Ruby 1.9.3 commit 6a57dbb4f57cc407462101129eeaf9fe3fee8045 Author: Hannes Wyss <hwyss@ywesee.com> Date: Thu Jul 30 13:29:05 2009 +0200 HtmlGrid is now Ruby 1.9 compatible
But the problem was caused, that I had not a clean checkout. Removing and reinstalling helped. Now I get another problem with incompatible libraries of hpricot and ydim-html
udo -u apache /usr/local/bin/ruby230 bin/ydim-htmld config=/etc/ydim/ydimd.yml /usr/local/lib/ruby/gems/2.3.0/gems/needle-1.3.0/lib/needle/definition-context.rb:36: warning: undefining `initialize' may cause serious problems /usr/local/lib/ruby/gems/2.3.0/gems/needle-1.3.0/lib/needle/definition-context.rb:36: warning: undefining `object_id' may cause serious problems /usr/local/lib/ruby/gems/2.3.0/gems/needle-1.3.0/lib/needle/definition-context.rb:36: warning: undefining `__send__' may cause serious problems /usr/local/lib/ruby/site_ruby/2.3.0/x86_64-linux/ydim/server.rb:65: warning: already initialized constant YDIM::Server::CONFIG /usr/local/lib/ruby/gems/2.3.0/gems/ydim-1.0.1/lib/ydim/server.rb:65: warning: previous definition of CONFIG was here /usr/local/lib/ruby/site_ruby/2.3.0/x86_64-linux/ydim/server.rb:66: warning: already initialized constant YDIM::Server::SECONDS_IN_DAY /usr/local/lib/ruby/gems/2.3.0/gems/ydim-1.0.1/lib/ydim/server.rb:66: warning: previous definition of SECONDS_IN_DAY was here could not find htmlgrid.so, falling back to pure-ruby class /var/www/ydim.ywesee.com/lib/ydim/html/view/htmlgrid.rb:16: warning: already initialized constant HtmlGrid::Component::HTTP_HEADERS /usr/local/lib/ruby/gems/2.3.0/gems/htmlgrid-1.0.8/lib/htmlgrid/component.rb:38: warning: previous definition of HTTP_HEADERS was here /var/www/ydim.ywesee.com/lib/ydim/html/view/htmlgrid.rb:81: warning: already initialized constant HtmlGrid::List::STRIPED_BG /usr/local/lib/ruby/gems/2.3.0/gems/htmlgrid-1.0.8/lib/htmlgrid/list.rb:46: warning: previous definition of STRIPED_BG was here /usr/local/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': incompatible library version - /usr/local/lib/ruby/gems/2.3.0/gems/hpricot-0.8.6/lib/hpricot_scan.so (LoadError) from /usr/local/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require' from /usr/local/lib/ruby/gems/2.3.0/gems/hpricot-0.8.6/lib/hpricot.rb:20:in `<top (required)>' from /usr/local/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require' from /usr/local/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require' from /usr/local/lib/ruby/gems/2.3.0/gems/sbsm-1.2.5/lib/sbsm/validator.rb:32:in `<top (required)>' from /usr/local/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require' from /usr/local/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require' from /var/www/ydim.ywesee.com/lib/ydim/html/util/validator.rb:5:in `<top (required)>' from /usr/local/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require' from /usr/local/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require' from /var/www/ydim.ywesee.com/lib/ydim/html/util/server.rb:8:in `<top (required)>' from /usr/local/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require' from /usr/local/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require' from bin/ydim-htmld:11:in `<main>'
Looks like a conflict between shared an static libraries, as I found the following occurrences
find /usr/local/lib64/ruby/gems/2.3.0/ -name hpricot_scan.so | xargs ls -lrt -rwxr-xr-x 1 root root 526863 20. Apr 11:43 /usr/local/lib64/ruby/gems/2.3.0/extensions/x86_64-linux/2.3.0-static/hpricot-0.8.6/hpricot_scan.so -rwxr-xr-x 1 root root 526911 26. Apr 11:25 /usr/local/lib64/ruby/gems/2.3.0/extensions/x86_64-linux/2.3.0/hpricot-0.8.6/hpricot_scan.so -rwxr-xr-x 1 root root 526911 26. Apr 11:25 /usr/local/lib64/ruby/gems/2.3.0/gems/hpricot-0.8.6/lib/hpricot_scan.so -rwxr-xr-x 1 root root 526911 26. Apr 11:25 /usr/local/lib64/ruby/gems/2.3.0/gems/hpricot-0.8.6/ext/hpricot_scan/hpricot_scan.so
Tried creating local gem ruby-dbi and dbd-pg in version 0.5.0.
But I think somehow the gems are not built correctly. Narrowed it it down by adding
def local_gems Gem::Specification.sort_by{ |g| [g.name.downcase, g.version] }.group_by{ |g| g.name } end puts local_gems['dbd-pg'] puts local_gems['pry'] require 'pry'; binding.pry
to bin/ydimd which gives mit the following output
#<Gem::Specification name=dbd-pg version=0.5.0> #<Gem::Specification name=pry version=0.10.3> /usr/local/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': incompatible library version - /usr/local/lib/ruby/gems/2.3.0/gems/byebug-8.2.4/lib/byebug/byebug.so (LoadError) from /usr/local/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
Recompiling ruby 2.3.0 without --enable-shared. This helped. Installing again version 0.4.6 of dbi and 0.3.9 of dbd-pg.
Now I am again able to start ydim and ydim-html. I however do not get farther than the login dialog. Also dropping into pry from ydim-html works fine.
Adding some debug statements to ydim and ydim-html it looks like the drb objects don't get passed correctly. Debugging tomorrow.