Mac Os 업데이트 중 bundle 업데이트 오류

5981 단어 MacRubyRails

먼저


제목에도 있습니다. Mac Os를 적용할 때bundle update 실행하면 오류가 발생합니다.
악전고투했기 때문에 먼저 써라.

잘못된 문장

$ bundle update

Fetching https://github.com/solidusio-contrib/solidus_i18n.git
NOTE: Gem::Specification#has_rdoc= is deprecated with no replacement. It will be removed on or after 2018-12-01.
Gem::Specification#has_rdoc= called from /Users/~/environment/~/vendor/bundle/ruby/2.5.0/bundler/gems/solidus_i18n-7d1552b32525/solidus_i18n.gemspec:24.
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependencyis only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
Fetching gem metadata from https://rubygems.org/..........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies......
Using rake 12.3.2
Using concurrent-ruby 1.1.4 (was 1.1.3)
Using i18n 1.3.0 (was 1.1.1)
Using minitest 5.11.3
Using thread_safe 0.3.6
Using tzinfo 1.2.5
Using activesupport 5.2.2
Using builder 3.2.3
Using erubi 1.8.0 (was 1.7.1)
Using mini_portile2 2.4.0 (was 2.3.0)
Fetching nokogiri 1.9.1 (was 1.8.5)
Installing nokogiri 1.9.1 (was 1.8.5) with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/~/environment/~/vendor/bundle/ruby/2.5.0/gems/nokogiri-1.9.1/ext/nokogiri
/Users/~/.rbenv/versions/2.5.1/bin/ruby -I /Users/~/.rbenv/versions/2.5.1/lib/ruby/site_ruby/2.5.0 -r
./siteconf20181229-51725-zmg84w.rb extconf.rb --use-system-libraries
checking if the C compiler accepts ... yes
checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future... no
Building nokogiri using system libraries.
ERROR: cannot discover where libxml2 is located on your system. please make sure `pkg-config` is installed.
*** 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=/Users/kanekoharuaki/.rbenv/versions/2.5.1/bin/$(RUBY_BASE_NAME)
        --help
        --clean
        --use-system-libraries
        --with-zlib-dir
        --without-zlib-dir
        --with-zlib-include
        --without-zlib-include=${zlib-dir}/include
        --with-zlib-lib
        --without-zlib-lib=${zlib-dir}/lib
        --with-xml2-dir
        --without-xml2-dir
        --with-xml2-include
        --without-xml2-include=${xml2-dir}/include
        --with-xml2-lib
        --without-xml2-lib=${xml2-dir}/lib
        --with-libxml-2.0-config
        --without-libxml-2.0-config
        --with-pkg-config
        --without-pkg-config
        --with-xslt-dir
        --without-xslt-dir
        --with-xslt-include
        --without-xslt-include=${xslt-dir}/include
        --with-xslt-lib
        --without-xslt-lib=${xslt-dir}/lib
        --with-libxslt-config
        --without-libxslt-config
        --with-exslt-dir
        --without-exslt-dir
        --with-exslt-include
        --without-exslt-include=${exslt-dir}/include
        --with-exslt-lib
        --without-exslt-lib=${exslt-dir}/lib
        --with-libexslt-config
        --without-libexslt-config

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /Users/~/environment/~/vendor/bundle/ruby/2.5.0/extensions/x86_64-darwin-17/2.5.0-static/nokogiri-1.9.1/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Users/~/environment/~/vendor/bundle/ruby/2.5.0/gems/nokogiri-1.9.1 for inspection.
Results logged to
/Users/~/environment/~/vendor/bundle/ruby/2.5.0/extensions/x86_64-darwin-17/2.5.0-static/nokogiri-1.9.1/gem_make.out

An error occurred while installing nokogiri (1.9.1), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.9.1' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  solidus was resolved to 2.7.1, which depends on
    solidus_frontend was resolved to 2.7.1, which depends on
      canonical-rails was resolved to 0.2.4, which depends on
        rails was resolved to 5.2.2, which depends on
          actioncable was resolved to 5.2.2, which depends on
            actionpack was resolved to 5.2.2, which depends on
              actionview was resolved to 5.2.2, which depends on
                rails-dom-testing was resolved to 2.0.3, which depends on
                  nokogiri

이 오류가 발생했을 때 우선 이 오류가 무엇인지 모르고 인터넷에서 찾아보려고 합니다.
하지만 일지로 잘 봐야 할 곳이 있다.
To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /Users/~/environment/~/vendor/bundle/ruby/2.5.0/extensions/x86_64-darwin-17/2.5.0-static/nokogiri-1.9.1/mkmf.log
우선 이 일지를 봅시다.

mkmf.로그에 쓴 오류

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
이런 착오가 생겼다.
이것은 Xcode를 설치하지 않으면 발생하는 오류라는 것을 알았다.
따라서 터미널에 다음 명령을 입력하십시오.
$ xcode-select --install

mkmf.log의 내용이 바뀌었지만 왠지 모르게 bundle 업데이트가 안 돼요.


이런 상황에서 이걸 실행하자.(* 여기서 해결했습니다)
$ sudo open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

결과적으로 나는 순조롭게 완성했다bundle update.

좋은 웹페이지 즐겨찾기