跳至主要內容

在 brew 環境下無法安裝 nokogiri 時的解決方法

· 1 分鐘閱讀

發生了以下兩個錯誤:

zlib is missing; necessary for building libxml2
xslt is missing. Please locate mkmf.log to investigate how it is failing.

解決方法

  • 安裝 libxslt 與 libxml2
  • 指定 brew 安裝的 libxml2 路徑
brew install libxslt libxml2
bundle config build.nokogiri --use-system-libraries --with-xml2-include=$(brew --prefix libxml2)/include/libxml2

參考網站

コメント

読み込み中...

コメントを投稿する