Subl命令不起作用-找不到命令 [英] Subl command not working - command not found
问题描述
我很难进行此设置.我修复了.bash_profile
,并使用Sublime网站上的以下命令创建了符号链接:
I'm having difficulty getting this set up. I fixed my .bash_profile
, and created the symlink using the following command from the Sublime website:
ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl
但是,当我输入该命令时,我得到了:
Yet, when I input that command I get:
ln: /Users/my_username/bin/subl: No such file or directory
看来我的终端在寻找文件的错误位置?为什么要尝试指向我的主目录上的bin
文件夹?
It appears my terminal is looking at the wrong place for the file? Why is it trying to point to a bin
folder on my home directory?
推荐答案
在/usr/local/bin
中而不是~/bin
中创建符号链接,并确保在PATH
中的/usr/local/bin
中.
Create the symlink in /usr/local/bin
instead of ~/bin
and make sure that /usr/local/bin
in in PATH
.
$ ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/.
$ echo $PATH
如果找不到/usr/local/bin/
,则将以下行添加到.bashrc
或.zshrc:
If you don't find /usr/local/bin/
, then add the following lines to your .bashrc
or .zshrc:
PATH=$PATH:/usr/local/bin/; export PATH
这篇关于Subl命令不起作用-找不到命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!