![見出し画像](https://assets.st-note.com/production/uploads/images/88055634/rectangle_large_type_2_0f01bf1172d3bafdd3d0f1c9ef6c5152.png?width=1200)
RStudioでパッケージをインストールする際の不具合
Mac OS Monterey 12.4
久しぶりにRStudioをMacで使おうとして、psychパッケージをインストールしようとしたらたくさんエラーが出てきました。
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
そこで、
ターミナルで
$ xcode-select --install
としてまずはxcodeを入れました。
もう1度psychパッケージをインストールしようとすると、
make: gfortran: No such file or directory というエラーが出てきてしまいました。
そこでPCに
gfortranをインストールしようとするが、古いバージョンだったらしく、
もう1度psychパッケージをインストールしようとすると、
今度は、
execvp: Bad CPU type in executable R
のようなエラーが出てくる・・・
そこで、以下のページから該当するMacのバージョンを選んでgfortranをPCにダウンロードしてインストールしました。
https://github.com/fxcoudert/gfortran-for-macOS/releases
gfortran 12.1 for Monterey (macOS 12) Latest
Standalone installer of GCC 12.1, including gfortran, for macOS Monterey (macOS 12). Two files are available:
gfortran-ARM-12.1-Monterey.dmg for Apple Silicon computers ⇨これをインストール
ようやくpsychパッケージがインストールできました。
この記事が気に入ったらサポートをしてみませんか?