maltize/sublime-text-2-ruby-tests

How to run tests when Sublime Text is NOT opened from the command line on OSX

MattDMo opened this issue · 4 comments

I just answered this question on StackOverflow about how to configure OSX Mountain Lion (not tested on earlier versions) to modify the internal PATH variable used by applications that are not opened from the command line, and I figured I'd share it with you so you could put it in the README, removing one limitation of your plugin :)


  1. Make sure you have admin privileges.

  2. Open Terminal or your favorite substitute and see if there's anything in the file /etc/launchd.conf:

    cat /etc/launchd.conf
    

    If you get an error like

    cat: /etc/launchd.conf: No such file or directory

    then continue with the next step. If the cat command does display some content, copy it to the clipboard.

  3. Create a new text file (⌘ N)with the following content, modified to fit your needs:

    setenv PATH /usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/Users/YourUserName/bin:/path/to/gems/bin
    

    If the cat command displayed some content in the previous step, paste it into the new file before the setenv PATH command. If it already contains a setenv PATH command, just modify it to add the directories you need, such as /path/to/gems/bin

  4. Save the new file in your home directory (/Users/YourUserName) as launchd.conf.

  5. Go back to Terminal and enter:

    sudo mv ~/launchd.conf /etc
    

    to use admin power to move the new file to /etc, replacing anything that was there before. You'll need to enter your password at this point.

  6. _Reboot your computer_

And you should be all set. This has only been tested on Mountain Lion (OSX 10.8), so you'll need to test it first if you're running an earlier version.


I hope this is helpful, it really was to me when I discovered it a few months back. If you need anything else, just let me know.

Matt

gs commented

wow, thats impressive, I will put link to that in readme section

I get this error: -bash: setenv: command not found in Mavericks.

@lperry65 You shouldn't be running that command from the command line - it needs to go in /etc/launchd.conf. Please keep in mind that I have not tested this on Mavericks, only Mountain Lion, so you do this at your own risk.