Installing UnicodeUtils

The easiest way to install UnicodeUtils is with RubyGems:

$ gem install unicode_utils

Manual installation

Two kinds of files must be installed:

  1. The library code. All files under lib/ and lib/unicode_utils/ with suffix .rb. The whole tree under lib/ must be on the load path.

  2. The compiled Unicode data files under cdata/. UnicodeUtils loads them from the UnicodeUtils::CDATA_DIR directory, which is defined in read_cdata.rb.

The best strategy is to copy the library files to Ruby’s sitelibdir. You can get that by running:

$ ruby -r rbconfig -e "puts Config::CONFIG['sitelibdir']"

Then copy all files under cdata/ to <sitelibdir>/unicode_utils. And last but not least, change the definition of CDATA_DIR in <sitelibdir>/unicode_utils/read_cdata.rb to File.absolute_path(File.dirname(__FILE__)).

In fact, UnicodeUtils comes with an install.rb script that does all that:

$ ruby install.rb install

or:

$ ruby install.rb install /some/other/dir