0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Claude Desktop の Preview が `~/Documents/Src` 配下で動かなかった話

0
Posted at

Claude Desktop の Preview 機能を、Mac の ~/Documents/Src 配下にある Rails プロジェクトで利用しようとしたところ、正常に動作しませんでした。

原因候補

macOS の保護フォルダ (Documents / Desktop / Downloads) に対する権限やサンドボックス制約の影響の可能性が高そうです。

GitHub Issue でも、以下のような報告が存在します。

  • Preview server が ~/Desktop 配下を読めない
  • Documents 配下で権限エラーが発生する
  • Full Disk Access を付与しても動作が不安定

回避策

ghq などを利用して、最初から ~/src 配下へリポジトリを集約しておくと安全です。

# 例
~/src/github.com/org/repo

ghq は Git リポジトリを一定ルールで管理できるツールで、AI ツール・CLI ツールとの相性も良いです。

特に Claude Desktop や Claude Code のように、ローカルファイルへ広くアクセスするツールでは、macOS の保護フォルダ (Documents / Desktop) を避けるメリットがあります。

プロジェクトを保護フォルダ外へ移動すると改善する可能性があります。

# NG例
~/Documents/Src/myapp

# OK例
~/src/myapp
~/dev/myapp

追加で確認したいこと

Rails アプリ側が起動できていることも重要です。

bin/dev
# または
bin/rails s

ブラウザで http://localhost:3000 が表示できる状態にしてから Claude Desktop に Preview させると動作する場合があります。

感想

Mac の Documents 配下は普段の開発では問題になりづらいですが、AI ツールや Preview 機能では macOS の権限制約に引っかかるケースがありそうでした。

Claude Desktop を試す場合は、最初から ~/src 配下などで開発する方が安全かもしれません。

0
0
0

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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?