1

Mac OS 10.8 と Ruby 1.9.3 を rbenv で実行する新しいマシンをセットアップしています。

何度も暫定的に開始し、多くの Stack Overflow の回答を読んだ後、次を使用して Nokogiri をインストールできました。

sudo gem install nokogiri -- --with-xml2-include=/usr/local/Cellar/libxml2/2.8.0/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.8.0/lib --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.28 --with-iconv-include=/usr/local/Cellar/libiconv/1.13.1/include --with-iconv-lib=/usr/local/Cellar/libiconv/1.13.1/lib
Building native extensions.  This could take a while...
Successfully installed nokogiri-1.5.6
1 gem installed

今、Rails アプリケーションをバンドルしようとしていますが、Nokogiri をインストールできません。libxml2 が見つからないというエラーが常に表示されます。

私が試した最後のコマンドは次のとおりです。

bundle config build.nokogiri -- --with-xml2-include=/usr/local/Cellar/libxml2/2.8.0/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.8.0/lib --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.28 --with-iconv-include=/usr/local/Cellar/libiconv/1.13.1/include --with-iconv-lib=/usr/local/Cellar/libiconv/1.13.1/lib
bundle install

これを解決する方法を知っている人はいますか?

4

2 に答える 2

0

config コマンドに -- は必要ありません。バンドル構成ページを参照してください。この質問が古いことは知っていますが、他の誰かが恩恵を受ける可能性があります。

bundle config build.nokogiri --with-xml2-include=/usr/local/Cellar/libxml2/2.8.0/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.8.0/lib --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.28 --with-iconv-include=/usr/local/Cellar/libiconv/1.13.1/include --with-iconv-lib=/usr/local/Cellar/libiconv/1.13.1/lib
bundle install

~/.bundle/config ファイルをチェックして、構成が適切に記録されているかどうかを確認できます。

また、このバグをバンドラーに送信しました。Syntax error: Unterminated quoted stringビルドに時間がかかったら、それを参照してください。

于 2014-05-30T21:07:08.917 に答える
0

Homebrew の更新されたインストール手順を試しましたか? FWIW、MacPortsで問題が発生したことはありません

于 2013-02-27T02:34:15.330 に答える