安装Mavericks之后,Sublime Text 2命令行不起作用 [英] Sublime Text 2 command line not working after Mavericks install
问题描述
我已经准备好通过Stack Overflow上的其他线程,尽管我付出了很多努力,但问题似乎仍未解决.由于安装了OS X Mavericks,因此无法从命令行打开Sublime Text 2.
I've ready through other threads on Stack Overflow and despite my efforts the issue doesn't seem to resolve. Since installing OS X Mavericks I'm not able to open Sublime Text 2 from the command line.
我已尝试遵循以下准则:
I've tried following these guidelines:
当我从终端运行此命令时,Sublime弹出,这很好: http://benkwok.wordpress.com/2013/11/17/setup-sublime-text-2-on-osx-mavericks-for-ruby-on-rails/
When I run this from the terminal Sublime pops up so that's good: http://benkwok.wordpress.com/2013/11/17/setup-sublime-text-2-on-osx-mavericks-for-ruby-on-rails/
我已将以下行添加到我的bash_profile的底部:
I've added these lines to the bottom of my bash_profile:
export PATH=/bin:/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:$PATH↲
export EDITOR='subl -w'
但是,当我尝试运行时:
However, when I try to run:
source ~/.bash_profile
从命令行中我得到:
-bash: rbenv: command not found
-bash: rbenv: command not found
-bash: Gemfile: command not found
当我尝试subl时.从其中包含文件的文件夹内部,出现以下错误:
When I try to subl . from inside a folder with files in it, I get the following error:
-bash: subl: command not found
因此,对于Mavericks,我的bash_profile显然配置错误.任何和所有帮助表示赞赏.
So, my bash_profile is obviously configured wrong for Mavericks. Any and all help appreciated.
推荐答案
该博客帖子有几处错误.首先,如果您使用Sublime Text 2,则符号链接指向错误的目标.应该是
There are a couple of things wrong with that blog post. First, the symlink is pointing to the wrong target if you're using Sublime Text 2. It should be
sudo ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
,因为应用程序的名称是Sublime Text 2.app
.崇高3命名为Sublime Text.app
.确保您运行
as the application's name is Sublime Text 2.app
. Sublime 3 is named Sublime Text.app
. Make sure you run
sudo rm /usr/local/bin/subl
在创建新的符号链接之前删除旧的(不正确的)符号链接.
to delete the old (incorrect) symlink before making the new one.
接下来,在export PATH
命令中有一个无效字符.应该是
Next, there is an invalid character in the export PATH
command. It should be
export PATH=/bin:/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:$PATH
,末尾没有↲
字符.
进行这些更改,退出终端并重新启动,您应该能够运行subl .
打开文件夹,或运行subl filename
打开单个文件.
Make these changes, exit Terminal and restart, and you should be able to run subl .
to open a folder, or subl filename
to open individual files.
这篇关于安装Mavericks之后,Sublime Text 2命令行不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!