getcursor / cursor

The AI Code Editor
https://cursor.com
23.2k stars 1.47k forks source link

brew install --cask, cursor ., grep: /proc/version: No such file or directory #1736

Open yinchuandong opened 2 weeks ago

yinchuandong commented 2 weeks ago

I used home brew to install cursor on mac, but failed to execute cursor .. It shows the following error:

grep: /proc/version: No such file or directory
/opt/homebrew/bin/cursor: line 62: /Applications/Cursor.app/Contents/Resources/app/bin/../cursor: No such file or directory

image

Reproduce

$ brew install --cask cursor
$ cursor .

Solution

After I manually edit line 62 in Applications/Cursor.app/Contents/Resources/app/bin/../cursor and remove .., it then works. But the cursor sh is somehow automatically removed in Applications/Cursor.app/Contents/Resources/app/bin/ folder. image

Instead, the cursor cmd is now linked to /usr/local/bin/cursor image

Environments

Chips version: Apple M2 Max mac os: 14.4.1 (23E224)

Aubermean commented 2 weeks ago

I have the same issue.

philippviereck commented 2 weeks ago

@yinchuandong wdym edit line 62? hard code the path - then I just have an infinite loop of the program calling itself? ... I cannot get the dirty fix to work.

/usr/local/bin/cursor <path>

works as I would expect cursor <path> to work

Screenshot 2024-08-28 at 20 15 24

EDIT: I replaced the whole script at Applications/Cursor.app/Contents/Resources/app/bin/cursor with this:

#!/usr/bin/env sh

# Use the correct path for Cursor
CURSOR_PATH="/usr/local/bin/cursor"

# Check if Cursor exists at the specified path
if [ ! -f "$CURSOR_PATH" ]; then
    echo "Error: Cursor executable not found at $CURSOR_PATH" >&2
    exit 1
fi

# Execute Cursor with all passed arguments
exec "$CURSOR_PATH" "$@"
Aubermean commented 2 weeks ago

I got an email of a fix someone posted here, but they deleted it. Here it is:

rm /opt/homebrew/bin/cursor
ln -s /Applications/Cursor.app/Contents/Resources/app/cursor /opt/homebrew/bin/cursor

Since the Cursor dev team don't handle brew issues, we should fix it or report it here: https://github.com/Homebrew/homebrew-cask/blob/master/Casks/c/cursor.rb

Aubermean commented 2 weeks ago

I made an PR to homebrew-cask with the fix, someone introduced the bug 5 days ago.

https://github.com/Homebrew/homebrew-cask/pull/183762