Sublime Text does not open when typing subl test at the terminal

Asked 1 years ago, Updated 1 years ago, 85 views

I want to open Sublime Text by typing subl test and terminal, but I can't open it because PATH doesn't work.
Please let me know the possible causes and things I should look into.

The subl cannot be opened because PATH is not passing, so I tried executing the code that PATH was introduced to pass by referring to This HP, but it didn't work.

M1 Mac

●Sublime Text.app is under Applications

nakamotookenta @nakamotookentanoMacBook - Air Sublime Text.app%pwd
/Applications/Sublime Text.app

There is also a subl in ●bin

nakamotookenta @nakamotookentanoMacBook-Air Sublime Text.app%cdContents/SharedSupport/bin
Nakamotookenta @nakamotookentanoMacBook - Airbin%ls
subl

●This is my PATH

/Users/nakamotookenta/.pyenv/bin:/Users/nakamotookenta/.pyenv/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/sbin:/sbin:/sbin

There was a folder called ●/usr/local/bin

nakamotookenta @nakamotookentanoMacBook-Airbin%cd/usr/local/bin
Nakamotookenta @nakamotookentanoMacBook - Airbin%pwd
/usr/local/bin

There was no folder called ●/Users/nakamotookenta/.pyenv/bin (I think this is the reason)

nakamotookenta @nakamotookentanoMacBook-Airbin%cd/Users/nakamotookenta/.pyenv/bin
cd: no such file or directory: /Users/nakamotookenta/.pyenv/bin
ln-s/Applications/Sublime\Text.app/Contents/SharedSupport/bin/subl/Users/nakamotookenta/.pyenv/bin.

After changing the code in the course, /usr/local/bin, and doing this

 ln:/Users/nakamotookenta/.pyenv/bin.—File exists

The file says it exists

zsh:command not found:subl

This is what I saw when I typed subl test

ln-s/Applications/Sublime\Text.app/Contents/SharedSupport/bin/subl/usr/local/bin/.

If you type in the code in the course,

ln:/usr/local/bin/./subl:permission denied

Access Denied

zsh:command not found:subl

This is what I saw when I typed subl test

sublimetext

2022-09-30 11:15

2 Answers

$sudo town-R$(whoami)/usr/local/bin

was resolved by running and changing the owner in the folder to himself.
Thank you for your reply, Cubick and Hata.

I overlooked the additions to this site


2022-09-30 11:15

Create a symbolic link by doing the following, and then try running subl again.

$ln-s"/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"/usr/local/bin


2022-09-30 11:15

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.