Help us understand the problem. What is going on with this article?

Mac mojaveにして出たエラー

More than 1 year has passed since last update.

環境

MacOS mojave(10.14(18A391))
MacBook Pro (Retina, 13-inch, Mid 2014)
Xcode 9.4.1(作業後アップデートしたので記憶によると)
ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin18]

エラー

bundle install --clean --path vendor/bundle で下記のエラーが出る

Installing ruby-ll 2.1.2 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/natsuki/Desktop/office/Project/vendor/bundle/ruby/2.3.0/gems/ruby-ll-2.1.2/ext/c
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r ./siteconf20180930-30045-1vxexql.rb extconf.rb
creating Makefile

current directory: /Users/natsuki/Desktop/office/Project/vendor/bundle/ruby/2.3.0/gems/ruby-ll-2.1.2/ext/c
make "DESTDIR=" clean

current directory: /Users/natsuki/Desktop/office/Project/vendor/bundle/ruby/2.3.0/gems/ruby-ll-2.1.2/ext/c
make "DESTDIR="
make: *** No rule to make target
`/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/universal-darwin18/ruby/config.h',
needed by `driver.o'.  Stop.

make failed, exit code 2

Gem files will remain installed in /Users/natsuki/Desktop/office/Project/vendor/bundle/ruby/2.3.0/gems/ruby-ll-2.1.2 for inspection.
Results logged to /Users/natsuki/Desktop/office/Project/vendor/bundle/ruby/2.3.0/extensions/universal-darwin-18/2.3.0/ruby-ll-2.1.2/gem_make.out

An error occurred while installing ruby-ll (2.1.2), and Bundler cannot continue.
Make sure that `gem install ruby-ll -v '2.1.2'` succeeds before bundling.

In Gemfile:
  danger-android_lint was resolved to 0.0.6, which depends on
    oga was resolved to 2.15, which depends on
      ruby-ll

自分の環境での解決法

Xcode 10をインストールして、コマンドラインツールを更新すること

確認した内容

深いところまで追えてないんですが…以前のOSアップデートでも似たようなエラーが出た。
Make sure thatgem install ruby-ll -v '2.1.2'succeeds before bundling. とあるので試してみる

Building native extensions.  This could take a while...
ERROR:  Error installing ruby-ll:
    ERROR: Failed to build gem native extension.

    current directory: /Library/Ruby/Gems/2.3.0/gems/ruby-ll-2.1.2/ext/c
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r ./siteconf20180930-8289-7w85h9.rb extconf.rb
Ignoring curb-0.9.3 because its extensions are not built.  Try: gem pristine curb --version 0.9.3
creating Makefile

current directory: /Library/Ruby/Gems/2.3.0/gems/ruby-ll-2.1.2/ext/c
make "DESTDIR=" clean

current directory: /Library/Ruby/Gems/2.3.0/gems/ruby-ll-2.1.2/ext/c
make "DESTDIR="
make: *** No rule to make target `/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/universal-darwin18/ruby/config.h', needed by `driver.o'.  Stop.

make failed, exit code 2

Gem files will remain installed in /Library/Ruby/Gems/2.3.0/gems/ruby-ll-2.1.2 for inspection.
Results logged to /Library/Ruby/Gems/2.3.0/extensions/universal-darwin-18/2.3.0/ruby-ll-2.1.2/gem_make.out

こんな感じのエラー出る
curb-0.9.3 ビルドできてないよ、って言われるので以前もこんなの出たな…ってことで入れようとしてみる
sudo gem install curb -v '0.9.3'
rubyのアンインストールとかしないとダメかな…とか思いつつログ読んでた
ログが全部は残ってないんですが下記みたいなやつがあった

Warning: Your Xcode (9.4.1) is outdated.
Please update to Xcode 10.0 (or delete it).
Xcode can be updated from
  https://developer.apple.com/download/more/

If 10.0 is installed, you may need to:
  sudo xcode-select --switch /Applications/Xcode.app
Current developer directory is:
  /Applications/Xcode.app/Contents/Developer

もしくはcommand line toolが古いのでアップデートしてね、みたいなログが出た。
要はOSは最新だけどコマンドラインツールが古いからgemの更新時に不具合が出ているらしい。
brew doctorとかやってもXcode古いってwarningが出るので、Xcodeのせいと判別

解決するためにやったこと

XcodeをAppStoreから10にアップデート(2時間くらいかかる)
Xcode起動→コマンドラインツールをインストールしたら直った

High SierraだかSierraにした時も起こったのでメモしておきます

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away