Skip to content

Instantly share code, notes, and snippets.

@ptantiku
Created March 25, 2016 21:33
Show Gist options
  • Select an option

  • Save ptantiku/0c73e00012941505c614 to your computer and use it in GitHub Desktop.

Select an option

Save ptantiku/0c73e00012941505c614 to your computer and use it in GitHub Desktop.
install libthai4r
#!/bin/bash
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install -y libdatrie-dev libthai-dev
cd /tmp
mkdir libthai4r && curl -L https://github.com/ptantiku/libthai4r/tarball/master | tar xz --strip 1 -C libthai4r
cd libthai4r
ruby extconf.rb
make
sudo make install
# optional: test thai word break
# ruby test/thbrk.rb
# expected: ภาษา|ไทย|เป็น|ภาษา|ที่|ง่าย|ที่สุด|ใน|โลก
@pepa65
Copy link

pepa65 commented Mar 26, 2016

Am I missing some ruby files?? Output of dpkg -l |grep ruby:

ii  libmruby-dev                         1.2.0+20160315+git4f20d58a-1             amd64        lightweight implementation of the Ruby language (development files)
ii  libruby2.3:amd64                     2.3.0-4ubuntu3                           amd64        Libraries necessary to run Ruby 2.3
ii  rake                                 10.5.0-2                                 all          ruby make-like utility
ii  ruby                                 1:2.3.0+1                                all          Interpreter of object-oriented scripting language Ruby (default version)
ii  ruby-all-dev                         1:2.3.0+1                                all          Ruby development environment (all versions supported in Debian)
ii  ruby-build                           20151028-1                               all          tool to compile and install different versions of Ruby
ii  ruby-bundler                         1.11.2-1                                 all          Manage Ruby application dependencies (runtime)
ii  ruby-dev:amd64                       1:2.3.0+1                                amd64        Header files for compiling extension modules for Ruby (default version)
ii  ruby-did-you-mean                    1.0.0-2                                  all          smart error messages for Ruby > 2.3
ii  ruby-docile                          1.1.5-1                                  all          Docile keeps your Ruby DSLs tame and well-behaved
ii  ruby-ffi                             1.9.10debian-1build2                     amd64        load dynamic libraries, bind functions from within ruby code
ii  ruby-json                            1.8.3-1build4                            amd64        JSON library for Ruby
ii  ruby-minitest                        5.8.4-2                                  all          Ruby test tools supporting TDD, BDD, mocking, and benchmarking
ii  ruby-molinillo                       0.4.3-1                                  all          generic dependency resolution algorithm
ii  ruby-net-http-persistent             2.9.4-1                                  all          Manages persistent connections using Net::HTTP
ii  ruby-net-telnet                      0.1.1-2                                  all          telnet client library
ii  ruby-power-assert                    0.2.7-1                                  all          library showing values of variables and method calls in an expression
ii  ruby-simplecov                       0.11.1-1                                 all          code coverage for Ruby 1.9+
ii  ruby-simplecov-html                  0.10.0-1                                 all          default HTML formatter for SimpleCov code coverage tool
ii  ruby-test-unit                       3.1.7-2                                  all          unit testing framework for Ruby
ii  ruby-thor                            0.19.1-2                                 all          Ruby scripting framework
ii  ruby2.3                              2.3.0-4ubuntu3                           amd64        Interpreter of object-oriented scripting language Ruby
ii  ruby2.3-dev:amd64                    2.3.0-4ubuntu3                           amd64        Header files for compiling extension modules for the Ruby 2.3
ii  rubygems-integration                 1.10                                     all          integration of Debian Ruby packages with Rubygems

@pepa65
Copy link

pepa65 commented Mar 26, 2016

My output of ruby extconf.rb:

checking for package libthai >= 0.1.1 ... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/usr/bin/$(RUBY_BASE_NAME)2.3

Output of dpkg -l |grep libdatrie:

ii  libdatrie-dev:amd64                  0.2.10-2                                 amd64        Development files for double-array trie library
ii  libdatrie1:amd64                     0.2.10-2                                 amd64        Double-array trie library

Output of dpkg -l |grep libthai:

ii  libthai-data                         0.1.24-2                                 all          Data files for Thai language support library
ii  libthai-dev:amd64                    0.1.24-2                                 amd64        Development files for Thai language support library
ii  libthai0:amd64                       0.1.24-2                                 amd64        Thai language support library

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment