An error occurred while installing nokogiri (1.6.2.1), and Bundler cannot continue.

3420 단어
시스템은macos10.11,commandtool 등입니다.
bundle 설치를 실행하는 동안 다음 오류가 발생했습니다.
An error occurred while installing nokogiri (1.6.2.1), and Bundler cannot continue.

  Make sure that `gem install nokogiri -v '1.6.2.1'` succeeds before bundling.
다음 오류가 발생했습니다.
Installing nokogiri 1.6.2.1 with native extensions
Building nokogiri using packaged libraries.

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /usr/local/bin/ruby extconf.rb
Building nokogiri using packaged libraries.
-----
libiconv is missing.  please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
-----
*** 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/local/bin/ruby
    --help
    --clean
    --use-system-libraries
    --enable-static
    --disable-static
    --with-zlib-dir
    --without-zlib-dir
    --with-zlib-include
    --without-zlib-include=${zlib-dir}/include
    --with-zlib-lib
    --without-zlib-lib=${zlib-dir}/lib
    --enable-cross-build
    --disable-cross-build


Gem files will remain installed in /Users/sophia/ashelf/vendor/bundle/gems/nokogiri-1.6.2.1 for inspection.
Results logged to /Users/sophia/ashelf/vendor/bundle/gems/nokogiri-1.6.2.1/ext/nokogiri/gem_make.out

"libiconv is missing. please visithttp://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.”
이 방법을 시험해 보았다.
 brew install libiconv
brew link libiconv
그리고 출력된 링크 주소가 "/usr/local/Cellar/libiconv/1.14/"인 것을 보십시오.
명령 실행:
gem install nokogiri  -v '1.6.2.1' -- --with-iconv-dir=/usr/local/Cellar/libiconv/1.14/
bundle install은 여전히 안 됩니다. 마지막으로 방법을 찾습니다.
bundle config build.nokogiri -v '1.6.2.1' \

      --with-iconv-lib=/usr/local/lib \

      --with-iconv-include=/usr/local/include

그리고 번들 설치하면 돼요.
 
위의 명령은 매번 실행할 때마다 v'1.6.2.1'을 추가하지 않았기 때문에 1.6.7.2를 계속 설치하여 bundle install 총 실패를 초래했습니다.

좋은 웹페이지 즐겨찾기