view · edit · sidebar · attach · print · history

20110106-setup-oddb_org-windows

<< | Index | >>


  1. Install gd2 on Windows7 suspend
  2. Install de.oddb on Windows7 suspend
  3. Check difference between rkj-character-encodings (0.4.1) and character-encodings (0.4.1)

Goal
  • Setup oddb.org on Windows7 / 70%
Milestones
  1. Install gd2
Summary
Commits
ToDo Tomorrow
Keep in Mind
  1. swissmedic_followers debug
  2. On Ice
  3. emerge --sync

Install gd2 on Windows7

Reference

Install de.oddb on Windows7

Reference

I got the same

C:/Ruby186/lib/ruby/gems/1.8/gems/de.oddb-2.0.0/lib/oddb/html/util/known_user.rb:19:in `initialize': invalid encoding ("utf8", "la
tin1") (Iconv::InvalidEncoding)
        from C:/Ruby186/lib/ruby/gems/1.8/gems/de.oddb-2.0.0/lib/oddb/html/util/known_user.rb:19:in `new'
        from C:/Ruby186/lib/ruby/gems/1.8/gems/de.oddb-2.0.0/lib/oddb/html/util/known_user.rb:19
        from C:/Ruby186/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from C:/Ruby186/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from C:/Ruby186/lib/ruby/gems/1.8/gems/de.oddb-2.0.0/lib/oddb/util/server.rb:4
        from C:/Ruby186/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from C:/Ruby186/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from C:/Ruby186/lib/ruby/gems/1.8/gems/de.oddb-2.0.0/lib/oddb/util.rb:9
        from C:/Ruby186/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from C:/Ruby186/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from C:/Ruby186/lib/ruby/gems/1.8/gems/de.oddb-2.0.0/bin/oddbd:11
        from C:/Ruby186/bin/oddbd:19:in `load'
        from C:/Ruby186/bin/oddbd:19
  • Download data from de.oddb server (save it in home dir)
  • Import
    1. [Start Menu] -> [PostgreSQL 8.4] -> [pgAdmin III]
    2. Create database: oddb
    3. Create login role: oddb (passwd: oddb)
    4. [Start Menu] -> [PostgreSQL 8.4] -> [SQL Shell (psql)]
    5. \cd [home dir]
    6. \i [oddb sql] (import a sql file)

Run oddbd (de.oddb)

  • 'utf8 latin1' error

Set PATH for postgresql commands

  • [Computer] (right click) -> [Eigenschaften] -> [Erweiterte Systemeistellung] -> [Umgebungsvariablen]
  • Add 'C:\Program Files (x86)\PostgreSQL\8.4\bin;' to PATH
 C:\Ruby186\bin;C:\Program Files (x86)\Vim\vim73\;C:\Program Files (x86)\PostgreSQL\8.4\bin;

Install devkit

Reference

Then

  • I can use make, gcc, etc.

I can also create a database by using 'createdb' command

 createdb -U oddb -E utf8 -T template0 oddb

Install libIconv for Windows

Set PATH

 C:\Ruby186\bin;C:\Program Files (x86)\Vim\vim73\;C:\Program Files (x86)\PostgreSQL\8.4\bin;C:\mingw\bin;C:\mingw\mingw\bin;C:\Program Files (x86)\GnuWin32\bin;

Iconv test

C:\Users\masa>type test.rb

require 'iconv'

#i = Iconv.new('utf8','latin1')
i = Iconv.new('UTF-8','LATIN1')
p i

Result

C:\Users\masa>ruby test.rb
#<Iconv:0x42868c8>

Note

  • It works
  • The names of encode depends on a platform (OS)

Experiment

C:\Users\masa>vim C:/Ruby186/lib/ruby/gems/1.8/gems/de.oddb-2.0.0/lib/oddb/html/util/known_user.rb

  #@@iconv = Iconv.new('utf8', 'latin1')
  @@iconv = Iconv.new('UTF-8', 'LATIN1')

Run oddbd

C:/Ruby186/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- htmlgrid/divtem
plate (LoadError)
        from C:/Ruby186/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from C:/Ruby186/lib/ruby/gems/1.8/gems/de.oddb-2.0.0/lib/oddb/html/view/template.rb:4
        from C:/Ruby186/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from C:/Ruby186/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from C:/Ruby186/lib/ruby/gems/1.8/gems/de.oddb-2.0.0/lib/oddb/html/view/drugs/template.rb:4
        from C:/Ruby186/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from C:/Ruby186/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from C:/Ruby186/lib/ruby/gems/1.8/gems/de.oddb-2.0.0/lib/oddb/html/view/drugs/init.rb:4
         ... 13 levels...
        from C:/Ruby186/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from C:/Ruby186/lib/ruby/gems/1.8/gems/de.oddb-2.0.0/bin/oddbd:11
        from C:/Ruby186/bin/oddbd:19:in `load'
        from C:/Ruby186/bin/oddbd:19

Note

  • The 'utf8 latin' error has gone
  • This code can also run on Linux (Gentoo, Funtoo)

Install

  • htmlgrid (gem)
  • fastercsv (gem)

Run oddbd

C:/Ruby186/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': C:/Ruby186/lib/ruby/gems/1.8/gems/de.od
db-2.0.0/lib/oddb/import/pharmnet.rb:556: undefined (?...) sequence: /(?<!nicht )akzeptieren/ (SyntaxError)
C:/Ruby186/lib/ruby/gems/1.8/gems/de.oddb-2.0.0/lib/oddb/import/pharmnet.rb:788: undefined (?...) sequence: /^(?<name>.*?)\s*-\s*O
P((?<size>\d+)|\((?<multi>\d+)x(?<size>\d+)\))(\((?<unit>[^)]+)\))?$/
        from C:/Ruby186/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from C:/Ruby186/lib/ruby/gems/1.8/gems/de.oddb-2.0.0/lib/oddb/html/state/drugs/admin/package.rb:6
        from C:/Ruby186/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from C:/Ruby186/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from C:/Ruby186/lib/ruby/gems/1.8/gems/de.oddb-2.0.0/lib/oddb/html/state/viral/admin.rb:4
        from C:/Ruby186/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from C:/Ruby186/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from C:/Ruby186/lib/ruby/gems/1.8/gems/de.oddb-2.0.0/lib/oddb/html/state/login.rb:4
         ... 16 levels...
        from C:/Ruby186/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from C:/Ruby186/lib/ruby/gems/1.8/gems/de.oddb-2.0.0/bin/oddbd:11
        from C:/Ruby186/bin/oddbd:19:in `load'
        from C:/Ruby186/bin/oddbd:19

Note

  • This is the oniguruma problem

Check Ruby version

C:\Users\masa>ruby -v
ruby 1.8.6 (2010-02-04 patchlevel 398) [i386-mingw32]

Install win-bash

Put win-bash.exe in the directory of PATH (anywere)

  • Then we can use bash commands from dos prompt

Install patch for windows

Install tar for windows

Install gzip for windows

Install Ruby 1.8.6 with oniguruma patch

Reference

Result

  • make error
ruby.c: In function 'ruby_init_loadpath':
ruby.c:318:42: warning: universal character names are only valid in C++ and C99
ruby.c:318:42: error: incomplete universal character name \U
ruby.c:318:42: warning: unknown escape sequence: '\m'
ruby.c:318:42: warning: unknown escape sequence: '\w'
ruby.c:322:45: warning: universal character names are only valid in C++ and C99
ruby.c:322:45: error: incomplete universal character name \U
ruby.c:322:45: warning: unknown escape sequence: '\m'
ruby.c:322:45: warning: unknown escape sequence: '\w'
ruby.c:323:41: warning: universal character names are only valid in C++ and C99
ruby.c:323:41: error: incomplete universal character name \U
ruby.c:323:41: warning: unknown escape sequence: '\m'
ruby.c:323:41: warning: unknown escape sequence: '\w'
make: *** [ruby.o] Error 1

Install Ruby 1.8.6 with oniguruma patch on Cygwin

  • Success

Install de.oddb through gem

  1. de.oddb
  2. rclconf
  3. facets (-v=1.8.54)
  4. odba
  5. pg (-v=0.9.0)
  6. dbd-pg
    • dbi
    • deprecated
  7. sbsm
  8. mod: /cygdrive/c/Users/masa/ruby186_2/lib/ruby/gems/1.8/gems/de.oddb-2.0.0/lib/oddb/html/util/known_user.rb
 #@@iconv = Iconv.new('utf8', 'latin1')
 @@iconv = Iconv.new('UTF-8', 'LATIN1')
  1. htmlgrid
  2. fastercsv
  3. htmlentities
  4. mechanize
    • nokogiri
  • Error when mechanize is installed
$ ./gem install mechanize
Fetching: nokogiri-1.4.4.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing mechanize:
        ERROR: Failed to build gem native extension.

/cygdrive/c/Users/masa/ruby186/bin/ruby.exe extconf.rb
checking for #include <libxml/parser.h>
... no
-----
libxml2 is missing.  please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
-----

Install libxml2, libxml2-devel and libxsl, libxsl-devel through cygwin setup.exe

Install openssl, openssl-devel through cygwin

Error

/cygdrive/c/Users/masa/ruby186/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `gem_original_require': no such file to load --
openssl (LoadError)
        from /cygdrive/c/Users/masa/ruby186/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `require'
        from /cygdrive/c/Users/masa/ruby186/lib/ruby/1.8/net/https.rb:102
        from /cygdrive/c/Users/masa/ruby186/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `gem_original_require'
        from /cygdrive/c/Users/masa/ruby186/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `require'
        from /cygdrive/c/Users/masa/ruby186/lib/ruby/gems/1.8/gems/mechanize-1.0.0/lib/mechanize.rb:2
        from /cygdrive/c/Users/masa/ruby186/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:34:in `gem_original_require'
        from /cygdrive/c/Users/masa/ruby186/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:34:in `require'
        from /cygdrive/c/Users/masa/ruby186/lib/ruby/gems/1.8/gems/de.oddb-2.0.0/lib/oddb/import/pharmnet.rb:6
         ... 25 levels...
        from /cygdrive/c/Users/masa/ruby186/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `require'
        from /cygdrive/c/Users/masa/ruby186/lib/ruby/gems/1.8/gems/de.oddb-2.0.0/bin/oddbd:11
        from /usr/bin/oddbd:19:in `load'
        from /usr/bin/oddbd:19

Note

  • 'openssl' is a standard library for Ruby 1.8.6
  • I guess openssl and openssl-devel libraries should be installed before compiling Ruby

Re-conpile Ruby

  • Then the openssl error has gone

Error

/cygdrive/c/Users/masa/ruby186_2/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `gem_original_require': no such file to load -
- encoding/character/utf-8 (LoadError)
        from /cygdrive/c/Users/masa/ruby186_2/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `require'
        from /cygdrive/c/Users/masa/ruby186_2/lib/ruby/gems/1.8/gems/de.oddb-2.0.0/lib/oddb/import/importer.rb:1
        from /cygdrive/c/Users/masa/ruby186_2/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `gem_original_require'
        from /cygdrive/c/Users/masa/ruby186_2/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `require'
        from /cygdrive/c/Users/masa/ruby186_2/lib/ruby/gems/1.8/gems/de.oddb-2.0.0/lib/oddb/import/pharmnet.rb:7
        from /cygdrive/c/Users/masa/ruby186_2/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `gem_original_require'
        from /cygdrive/c/Users/masa/ruby186_2/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `require'
        from /cygdrive/c/Users/masa/ruby186_2/lib/ruby/gems/1.8/gems/de.oddb-2.0.0/lib/oddb/html/state/drugs/admin/package.rb:6
         ... 22 levels...
        from /cygdrive/c/Users/masa/ruby186_2/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `require'
        from /cygdrive/c/Users/masa/ruby186_2/lib/ruby/gems/1.8/gems/de.oddb-2.0.0/bin/oddbd:11
        from /usr/bin/oddbd:19:in `load'
        from /usr/bin/oddbd:19

Install character-encodings

make
gcc -I. -I/cygdrive/c/Users/masa/ruby186_2/lib/ruby/1.8/i386-cygwin -I/cygdrive/c/Users/masa/ruby186_2/lib/ruby/1.8/i386-cygwin -I. -DH
AVE_ASSERT_H -DHAVE_LIMITS_H -DHAVE_LOCALE_H -DHAVE_STDBOOL_H -DHAVE_STDDEF_H -DHAVE_STDINT_H -DHAVE_STDIO_H -DHAVE_STDLIB_H -DHAVE_STR
ING_H -DHAVE_SYS_TYPES_H -DHAVE_WCHAR_H   -g -O2  -std=c99 -finline-functions -Wall -Wextra -Wwrite-strings -Waggregate-return -Wmissin
g-prototypes -Wmissing-declarations -Wnested-externs -Wundef -Wpointer-arith -Wcast-align -Werror -Winline  -c break.c
gcc -I. -I/cygdrive/c/Users/masa/ruby186_2/lib/ruby/1.8/i386-cygwin -I/cygdrive/c/Users/masa/ruby186_2/lib/ruby/1.8/i386-cygwin -I. -DH
AVE_ASSERT_H -DHAVE_LIMITS_H -DHAVE_LOCALE_H -DHAVE_STDBOOL_H -DHAVE_STDDEF_H -DHAVE_STDINT_H -DHAVE_STDIO_H -DHAVE_STDLIB_H -DHAVE_STR
ING_H -DHAVE_SYS_TYPES_H -DHAVE_WCHAR_H   -g -O2  -std=c99 -finline-functions -Wall -Wextra -Wwrite-strings -Waggregate-return -Wmissin
g-prototypes -Wmissing-declarations -Wnested-externs -Wundef -Wpointer-arith -Wcast-align -Werror -Winline  -c decompose.c
decompose.c: In function `_utf_normalize_wc':
decompose.c:410: Warnung: Sichtbarkeitsattribute werden in dieser Konfiguration nicht unterst"utzt; ignoriert
make: *** [decompose.o] Fehler 1


Gem files will remain installed in /cygdrive/c/Users/masa/ruby186_2/lib/ruby/gems/1.8/gems/character-encodings-0.4.1 for inspection.
Results logged to /cygdrive/c/Users/masa/ruby186_2/lib/ruby/gems/1.8/gems/character-encodings-0.4.1/ext/encoding/character/utf-8/gem_ma
ke.out

Note

  • This is what we got before

suspend

Check difference between rkj-character-encodings (0.4.1) and character-encodings (0.4.1)

Install character-encodings and rkj-character-encodings

masa@masa ~/work $ gem search character-encoding 

*** LOCAL GEMS ***

character-encodings (0.4.1)
rkj-character-encodings (0.4.1)

sample

require 'encoding/character/utf-8'
str = u"hëllö"
p str.length
  #=> 5
p str.reverse.length
  #=> 5
p str[/ël/]
  #=> "ël"

Reference

view · edit · sidebar · attach · print · history
Page last modified on January 06, 2011, at 03:28 PM