Can't build tags on OS X Mountain LIon #90

noonehos opened this Issue Nov 19, 2012 · 6 comments


None yet

5 participants


(ReOpened Issue from #18 becouse problem still need to answer)

OS X 10.8
ST 2
ctags 5.8 installed from mac ports

I'm getting the following error:

EnvironmentError: (u'ctags -R -f .tags', 1, 'ctags: illegal option -- R\nusage: ctags [-BFadtuwvx] [-f tagsfile] file ...\n')

But running ctags -R -f .tags works fine from the terminal (with sudo and without sudo).
And if I run ST2 from termainal with sudo (like :user$ sudo open /Applic.../S..T..2/...), all works fine
Any thoughts?


Okay, I am now have answer so i close issue.
I use command which ctags in terminal to see where it. In my case it's: /opt/local/bin/ctags but i have ctags also in /usr/bin/ctags, so i was confused. I try to set hardly path /opt/local/bin/ctags in plugin setings:
{ "debug" : false, "ctags_command" : "/opt/local/bin/ctags -R -f .tags", ... }
and its work!
results from ST2 console:
Re/Building CTags for /work/sources/DBtree/.tags: Please be patient Finished building /work/sources/DBtree/.tags

@noonehos noonehos closed this Nov 19, 2012

Great! Yeah, that is fine solution to specify the proper ctags in the settings file. The alternative would be to add the path to your desired ctags by adding it to your PATH environment variable. I usually just add an export statement to my ~/.bash_profile, which is the dominant profile file on OSX (others are ~/.bash_login and then ~/.profile). Refer to this post for more info:

If you want to go allllll the way, you can tack the ctags PATH modification in /etc/profile . This will then work for all users of your system, and also for shortcuts for launching Sublime
outside of the shell.


In my case alternative such export Path not work:
echo $PATH /opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

  • So my correct path to ctags /opt/local/bin/ and it first in $PATH but plugint not see it if i write in settings file simple 'ctags -R ...'
    works only with '/opt/local/bin/ctags -R...'

This worked for me in ST3 after brew install ctags.

Sublime3 -> Preferences -> Package Settings -> CTags -> Settings - User:

    "command" : "/usr/local/bin/ctags"
nejadb commented Mar 11, 2015

Worked for me! Even with "which ctags" pointing to the correct location I needed this in my settings to get it to work. Thank you.


@brianlow , Thanks, it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment