view · edit · sidebar · attach · print · history

Index>

20160425-ydim-html-ruby-2-3

Summary

  • Port ydim-html to Ruby 2.3
  • Port sbsm to passenger

Commits

Index

Keep in Mind for work to do
  • Fix dojo error http://www.sitepen.com/blog/2012/10/31/debugging-dojo-common-error-messages/#forgot-dom-ready
  • I removed on May-27 tests for ix_registrationss, fix_sequences, fix_compositions, fix_packages from test/test_plugin/swissmedic.rb,as he could not find any references for them in the src code. Did I erroneously remove stuff when cleaning up the swissmedic import earlier?
  • The whole test for older/newer Packages must be adapted to xlsx. One must compare the rows (e.g. by creating csv files) and do the same stuff in xlsx!
  • creat gem: task: input=file with ean-codes, standard output show ean-codes + atc-code. Source is Swissmedic Packungen.xlsx or XML.
  • Import via data/medreg_companies.yaml
  • Fix problem with radioactivatum 99m-technetio when parsing Wirkstoffe
  • Fix galenic_forms when parsing swissmedic.xlsx
  • Cleanup generic_type. Replace it everywhere by sl_generic_type and adapt code accordingly.
  • Get updated ATC-codes from EPha for oddb.org, too.
  • Use refdatabase for oddb.org, too.
  • Check whether we should revert the part which touche src/plugin/text_info.rb of commit 17af82ba4d76a5838683411b260de265531f9e74. We should improve test/stub/oddbapp.rb to work similar for update/pointer as the real oddbapp. In this case we would have a good Stub for plugins. May we need a different stub when working with plugins (which create/modify/destroy ODDB-Objects), when in most other cases a very simple stub is sufficient.
  • When a logged in admin user changes an atc_code of a product, the corresponding atc_class must update its sequences, too.
  • Order of entering search type and value should not matter. Both should show long URL with search
  • Remove parser for minifi (but keep the minifi)
  • BSV-Plugin does not send mail. Is it sending two mails at once?
  • remove obsolete pdf_patinfo in model, admin/views

Port ydim-html to Ruby 2.3

Before porting ydim-html to passenger, I will try

  1. start ydim and ydim-html Ruby 2.3.0. mod_ruby compiled against Ruby 1.9.3.
  2. start ydim and ydim-html Ruby 2.1.9. mod_ruby compiled against Ruby 2.1.9
  3. start ydim and ydim-html Ruby 2.3.0. mod_ruby compiled against Ruby 2.1.9

For point 2 and 3: Kompiling and installing Ruby 2.1.9 as ruby219 into /usr/local.

1) Testing using

  • ydim: sudo -u apache /usr/local/bin/ruby230 /home/niklaus/git/ydim/bin/ydimd
  • ydimd-html: sudo -u apache /usr/local/bin/ruby230 /var/www/ydim.ywesee.com/bin/ydim-htmld config=/etc/ydim/ydimd.yml

In this case I must replace load File.expand_path('../../etc/config.rb', __FILE__) by load '/var/www/ydim.ywesee.com/etc/config.rb' to avoid the error /var/www/ydim.ywesee.com/doc/index.rbx:8: Insecure operation - expand_path

Now I am getting errors loading rclconf, even that rclconf is installed as gem. This can be fixed by:

  • sudo ln -s /usr/local/lib/ruby/gems/2.3.0/gems/rclconf-1.0.0/lib/rclconf.rb /usr/local/lib/ruby/site_ruby/2.3.0/x86_64-linux
  • sudo ln -s /usr/local/lib/ruby/gems/2.3.0/gems/sbsm-1.2.6/lib/sbsm /usr/local/lib/ruby/site_ruby/2.3.0/x86_64-linux
  • sudo ln -s /usr/local/lib/ruby/2.3.0/x86_64-linux/cgi /usr/local/lib/ruby/site_ruby/2.3.0/x86_64-linux
  • sudo ln -s /usr/local/lib/ruby/gems/2.3.0/gems/htmlgrid-1.0.7/lib/htmlgrid /usr/local/lib/ruby/site_ruby/2.3.0/x86_64-linux
  • sudo ln -s /usr/local/lib/ruby/gems/2.3.0/gems/ydim-1.0.1/lib/ydim /usr/local/lib/ruby/site_ruby/2.3.0/x86_64-linux

Still having the following problems:

  • I can add a new customer, but I remark that instead saving a streetname "Wieshoschet" it is saved as "[Wieshoschet]". I think there is somewhere a problem that under Ruby 2.x the String class no longer has a method each, only each_line, each_char or each_byte.
  • Also a first name "Cécile" gets replaced by "Cécile" when saving.
  • Navigation does not work (e.g. cannot list open invoices, start creating an invoice.

2) Test using Ruby 2.1.9 and mod_ruby compiled against ruby 2.1.9 (which should give less friction)

  • Compiled mod_ruby (dist_clean) with ruby219 and installed it as /usr/lib64/apache2/modules/mod_ruby219.so
  • Changed /etc/apache2/modules.d/21_mod_ruby.conf to load /usr/lib64/apache2/modules/mod_ruby219.so
  • sudo gem219 install bundler # This install bundler (using ruby 219) into /usr/local/bin/bundler
  • cd /home/niklaus/git/ydim && /usr/local/bin/bundle install

This creates the followin problem

niklaus@oddb-ci2 ~/g/ydim> /usr/local/bin/bundle install
error: kann .git/FETCH_HEAD nicht öffnen: Keine Berechtigung

Remove /usr/local/bin/gem, /usr/local/bin/ruby and /usr/local/lib64/ruby/2.3.0 to force using a specific version of ruby. Running bundle exec rake gem && sudo /usr/local/bin/gem219 install pkg/ydim-1.0.1.gem under a git checkout of ngiger/ydim.

Now running sudo -u apache /usr/local/bin/ruby219 /home/niklaus/git/ydim/bin/ydimd leads to the following error

sudo -u apache /usr/local/bin/ruby219 /home/niklaus/git/ydim/bin/ydimd 
/usr/local/lib/ruby/gems/2.1.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.1.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.1.0/gems/needle-1.3.0/lib/needle/definition-context.rb:36: warning: undefining `__send__' may cause serious problems
FEHLER:  Relation �object� existiert bereits
FEHLER:  Relation �prefetchable_index� existiert bereits
FEHLER:  Relation �extent_index� existiert bereits
FEHLER:  Relation �object_connection� existiert bereits
FEHLER:  Relation �target_id_index� existiert bereits
FEHLER:  Relation �collection� existiert bereits
/usr/local/lib/ruby/2.1.0/delegate.rb:392:in `__getobj__': not delegated (ArgumentError)
        from /usr/local/lib/ruby/2.1.0/delegate.rb:341:in `block in delegating_block'
        from /usr/local/lib/ruby/gems/2.1.0/gems/dbi-0.4.5/lib/dbi/handles/statement.rb:214:in `fetch'
        from /usr/local/lib/ruby/gems/2.1.0/gems/dbi-0.4.5/lib/dbi/handles/statement.rb:240:in `each'
        from /usr/local/lib/ruby/gems/2.1.0/gems/dbi-0.4.5/lib/dbi/handles/database.rb:130:in `block in select_all'
        from /usr/local/lib/ruby/gems/2.1.0/gems/dbi-0.4.5/lib/dbi/handles/database.rb:88:in `execute'
        from /usr/local/lib/ruby/gems/2.1.0/gems/dbi-0.4.5/lib/dbi/handles/database.rb:128:in `select_all'
        from /usr/local/lib/ruby/gems/2.1.0/gems/dbd-pg-0.3.9/lib/dbd/pg/database.rb:173:in `columns'
        from /usr/local/lib/ruby/gems/2.1.0/gems/dbi-0.4.5/lib/dbi/handles/database.rb:161:in `columns'
        from /usr/local/lib/ruby/gems/2.1.0/gems/odba-1.1.0/lib/odba/connection_pool.rb:39:in `block in method_missing'
        from /usr/local/lib/ruby/gems/2.1.0/gems/odba-1.1.0/lib/odba/connection_pool.rb:29:in `next_connection'
        from /usr/local/lib/ruby/gems/2.1.0/gems/odba-1.1.0/lib/odba/connection_pool.rb:38:in `method_missing'
        from /usr/local/lib/ruby/gems/2.1.0/gems/odba-1.1.0/lib/odba/storage.rb:526:in `setup'
        from /usr/local/lib/ruby/gems/2.1.0/gems/odba-1.1.0/lib/odba/cache.rb:473:in `setup'
        from /home/niklaus/git/ydim/bin/ydimd:22:in `<main>'

3) Starting ydim/ydim-html with Ruby 2.3.0. Mod_ruby compiled against 2.1.9.

ydim and ydim-html start without problem. Starting apache2 fails now with the error /usr/lib64/apache2/modules/mod_ruby219.so: undefined symbol: ruby_dln_librefs. Is the consequence of having removed completely the ruby 2.1.9 (without the suffix 219)? Recompiling Ruby 2.1.9 again without a suffix. This did not help.

When checking my changes it sbsm since version 1.2.3, I found that I removed rockit, which is used to parse the URL. Rockit is available as version 0.7.1 or 0.7.2 via rubygems. We have on thinpower a very old version of rockit 0.3.8 under ruby 1.8.6.

But it looks as if Masa replaced rockit for oddb.org. Will analyse how to to same stuff for sbsm.rb.

Must correct implementation and test for sbsm/index.rb. Also updating some matchers to newer minitest version. Pushed commits

Now working on htmlgrid for ruby 2.3.0. Done in branch ruby2.x. Pushed commits

Updating yydim-html to use this newer version. Checking unit tests for ydim-html. All of them are selenium test. Therefore adding a new spec directory where I want to rewrite all the test using watir, as the selenium tests are way too old.

Must find tomorrow the proper way on howto start a HTTP-server (Hannes used webrick) and connect it to ydim (flexmock) server.

Port sbsm to passenger

As the whole interface of oddb.org/ydim to the HTTP server passes via sbsm, I start porting sbsm to passenger and trying to create a watir test, where we start the built in passenger web server to run the browser again.

Must replace the the CGI via the Rack library.

view · edit · sidebar · attach · print · history
Page last modified on April 25, 2016, at 05:33 PM