Subl命令不起作用-找不到命令 [英] Subl command not working - command not found

查看:143
本文介绍了Subl命令不起作用-找不到命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很难进行此设置.我修复了.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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆