> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-fix-nav-issues.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# MacOSの開発元検証エラーに対処する

> ClickHouseコマンドの実行時に表示されるMacOSの開発元検証エラーに、システム設定またはターミナルを使って対処する方法を学びます。

export const Image = ({img, alt, size}) => {
  return <Frame>
      <img src={img} alt={alt} />
    </Frame>;
};

***

<div id="fix-the-developer-verification-error-in-macos">
  ## macOSで開発元検証エラーを修正する
</div>

`brew` を使って ClickHouse をインストールすると、macOS でエラーが発生することがあります。
デフォルトでは、macOS は開発元を確認できない開発者が作成したアプリケーションやツールを実行しません。

`clickhouse` コマンドを実行しようとすると、次のエラーが表示されることがあります。

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/ldyQZWT-cIRJh7wo/images/knowledgebase/fix-the-developer-verification-error-in-macos/dev-verification-error.png?fit=max&auto=format&n=ldyQZWT-cIRJh7wo&q=85&s=966b59567470d5f5b08d4d1693c4e78b" size="md" alt="macOSの開発元検証エラーダイアログ" border width="372" height="404" data-path="images/knowledgebase/fix-the-developer-verification-error-in-macos/dev-verification-error.png" />

この開発元検証エラーを回避するには、システム設定で該当する設定を見つけるか、ターミナルを使用するか、ClickHouse を再インストールして、macOS の隔離からアプリを削除する必要があります。

<div id="system-settings-process">
  ## システム設定での手順
</div>

`clickhouse` 実行可能ファイルを隔離から外す最も簡単な方法は、次のとおりです。

1. **システム設定**を開きます。

2. **プライバシーとセキュリティ**に移動します。

   <Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/ldyQZWT-cIRJh7wo/images/knowledgebase/fix-the-developer-verification-error-in-macos/privacy-and-security-default-view.png?fit=max&auto=format&n=ldyQZWT-cIRJh7wo&q=85&s=cedd5521005c8e4d1fd45c2d9be97999" size="md" alt="macOSのプライバシーとセキュリティ設定のデフォルト表示" border width="827" height="737" data-path="images/knowledgebase/fix-the-developer-verification-error-in-macos/privacy-and-security-default-view.png" />

3. ウィンドウの一番下までスクロールし、*"「clickhouse-macos-aarch64」は、識別された開発元のものではないため、使用がブロックされました"* というメッセージを探します。

4. **このまま開く**をクリックします。

   <Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/ldyQZWT-cIRJh7wo/images/knowledgebase/fix-the-developer-verification-error-in-macos/privacy-and-security-screen-allow-anyway.png?fit=max&auto=format&n=ldyQZWT-cIRJh7wo&q=85&s=16bce3178cddf89d9a763f32f560abdf" size="md" alt="このまま開くボタンが表示されたmacOSのプライバシーとセキュリティ設定" border width="827" height="737" data-path="images/knowledgebase/fix-the-developer-verification-error-in-macos/privacy-and-security-screen-allow-anyway.png" />

5. macOS のユーザーパスワードを入力します。

これで、ターミナルで `clickhouse` コマンドを実行できるようになります。

<div id="terminal-process">
  ## ターミナルでの手順
</div>

`このまま開く` ボタンを押してもこの問題が解決しない場合は、コマンドラインからこの手順を実行することもできます。
単にコマンドラインで作業したい場合もあるでしょう。

まず、Homebrew が `clickhouse` 実行可能ファイルをどこにインストールしたかを確認します。

```shell theme={null}
which clickhouse
```

次のような出力が得られるはずです。

```shell theme={null}
/opt/homebrew/bin/clickhouse
```

前のコマンドで表示されたパスを指定して `xattr -d com.apple.quarantine` を実行し、`clickhouse` の隔離を解除します:

```shell theme={null}
xattr -d com.apple.quarantine /opt/homebrew/bin/clickhouse
```

これで、`clickhouse` 実行ファイルを実行できるはずです:

```shell theme={null}
clickhouse
```

以下のような出力になるはずです。

```shell theme={null}
以下のコマンドのいずれかを使用してください:
clickhouse local [args]
clickhouse client [args]
clickhouse benchmark [args]
...
```

<div id="fix-the-issue-by-reinstalling-clickhouse">
  ## ClickHouse を再インストールして問題を解決する
</div>

Brew には、インストールしたバイナリが最初から隔離されないようにするコマンドラインオプションがあります。

まず、ClickHouse をアンインストールします:

```shell theme={null}
brew uninstall clickhouse
```

ここで、`--no-quarantine` を指定して ClickHouse を再インストールします。

```shell theme={null}
brew install --no-quarantine clickhouse
```
