メモ的な何か

技術的な私のメモになる予定です。

macOSをMojaveにしたら問題が

問題

いままで普通にできてたことがMojaveに変えてからできなくなってしまいました。

1. brew installでエラーになる

私の環境だとこんなん出ました。
多分すでに入れてるものとか、入れようとしてるものによって違うけど。

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Error: An exception occurred within a child process:
CompilerSelectionError: python@2 cannot be built with any available compilers.
Install GNU's GCC
  brew install gcc

2. bundle installでエラーになる

これ以外にもいろいろでます。(長すぎるので)
これも環境によって違いそう。

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

解決策

以下をコマンドラインで実行

$ xcode-select --install
$ sudo open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

参考

Rails: macOSをMojaveにアップグレード後`bundle install`がエラーになった場合の対応方法 macOS Mojaveにアップデートして色々壊れる件 (homebrew, gem, nokogiri, gcloud) - Qiita