Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
MattDMo opened this issue Sep 1, 2013 · 4 comments

Comments

@MattDMo
Copy link

MattDMo commented Sep 1, 2013

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
Copy link
Collaborator

gs commented Oct 7, 2013

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

@gs gs closed this as completed Oct 7, 2013
@lperry65
Copy link

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

@MattDMo
Copy link
Author

MattDMo commented Sep 11, 2014

@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.

@jopotts
Copy link

jopotts commented Feb 20, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants