bash Sublime Text 2 和终端

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13217243/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 03:42:07  来源:igfitidea点击:

Sublime Text 2 and Terminal

bashterminalsublimetext2

提问by Connor Black

So I'm trying to make it so that I can start Sublime Text 2 from the terminal through this command, given by the Sublime Text documentation:

所以我正在尝试这样做,以便我可以通过这个命令从终端启动 Sublime Text 2,由 Sublime Text 文档给出:

ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl

But for some reason this is not working. I get this error from my terminal:

但由于某种原因,这是行不通的。我从终端收到此错误:

ln: /Users/connorblack/bin/subl: No such file or directory

Can anyone help me with this?

谁能帮我这个?

Other details: I have SB2 in my Applications folder. I'm trying to do RoR development.

其他详细信息:我的应用程序文件夹中有 SB2。我正在尝试进行 RoR 开发。

回答by yfrancis

Your problem is that you don't have a ~/bin directory, just do

你的问题是你没有 ~/bin 目录,就做

mkdir ~/bin

And then retry the command, it should work

然后重试该命令,它应该可以工作

Note that to use subl from this folder you will still need to add it to your PATH, add this line to your .bashrc or .zshrc:

请注意,要使用此文件夹中的 subl,您仍需要将其PATH添加到 .bashrc 或 .zshrc 中:

export PATH=$PATH:/Users/connorblack/bin