LoginSignup
8
8

More than 5 years have passed since last update.

FreeBSD で bundle install で nokogiri をインストールする。

Last updated at Posted at 2014-04-06

nokogiri ( gem ) のインストール時に libxml/libxslt/iconv への依存がある。

インストール時に gem のときは gem install nokogiri -- --with-xml2-lib=/usr/local/lib --with-xml2-include=/usr/local/include/libxml2 --with-xslt-lib=/usr/local/lib --with-xslt-include=/usr/local/include/libxslt --with-iconv-lib=/usr/local/lib --with-iconv-include=/usr/local/include とすればよいが、 bundler ( gem ) の場合、以下のように bundle config を利用する。

  • bundle config build.nokogiri -- --with-xml2-lib=/usr/local/lib --with-xml2-include=/usr/local/include/libxml2 --with-xslt-lib=/usr/local/lib --with-xslt-include=/usr/local/include/libxslt --with-iconv-lib=/usr/local/lib --with-iconv-include=/usr/local/include

この内容は ~/.bundle/config にストアされ、 bundle install 時などに参照される。

ただし、この状態だと bundle config で変な位置で改行が入ってしまうため、 bundle install 時に Syntax error: Unterminated quoted string が発生する。

対策として、 vim ~/.bundle/config などして改行を取り除くとよい。

参照

libxml/libxslt/iconv オプションの例示

bundle config コマンドの例示

8
8
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
8