1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

R に devtools がインストールできなかったので解決してみた。

Last updated at Posted at 2023-02-26

MacOS に Homebrew を使って R をインストールしました。

brew install R

その後、R で devtools をインストールしようと思ったのですがエラーがでてきました。

install.packages("devtools")
<stdin>:1:10: fatal error: 'hb-ft.h' file not found
#include <hb-ft.h>
         ^~~~~~~~~
1 error generated.

調べてみると、hb-ft.hというヘッダーファイルが見つからないことを示しており、
このヘッダーファイルは、HarfBuzzというオープンソースのテキストレイアウトエンジンで使用されるものとのこと。
つまり、このエラーはおそらくHarfBuzzがシステムにインストールされていないか、
インストールされているもののパスが設定されていないようです。
なので、次のコマンドでHarfBuzzがインストールされているか調べてみます。

brew list | grep harfbuzz

やはりインストールされていないので、次のコマンドでインストールしてみます。

brew install harfbuzz

そして、再度 devtools をインストールしてみます。すると次のエラーがでました。

string_bidi.cpp:11:10: fatal error: 'fribidi.h' file not found
#include <fribidi.h>

このエラーメッセージも調べてみると、fribidi.h というヘッダーファイルが見つからないことを示しており、このヘッダーファイルは、Unicodeテキストの双方向性を解決するためのFreeType Bidiライブラリで使用されるものなようです。

brew install fribidi

をしてみて再度実行しました。するとエラーが出ず devtools がインストールすることができました。

1
1
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?