Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I can't use my command line (terminal).

sudo gem install compass

but I only get "command not found". I'm admin om my Mac and my password is not blank.

I've also tried this:

defaults write com.apple.Finder AppleShowAllFiles YES

same result.

share|improve this question

migrated from stackoverflow.com Apr 19 '12 at 2:41

This question came from our site for professional and enthusiast programmers.

    
I'm not sure from what you've said whether only certain commands fail or whether it's the command line generally. Do simple things like 'ls' work? (If nothing works in Terminal, I'd try creating a fresh account to see if something in your user library was messed up._ –  Phillip Mills Apr 13 '12 at 11:43
    
I made a new account and I can use the Terminal there so you are problably right. Any suggestions on how to fix the user library? Thank you so much! –  Oskar Apr 13 '12 at 12:32
    
I really don't know what things would affect Terminal that way; I only know that creating a new account is my standard way of figuring out whether something is the system's fault or mine. :-) (For that matter, it could be something messed up in one of the account's login profile or control files instead -- maybe even more likely.) –  Phillip Mills Apr 13 '12 at 13:14
1  
The usual thing that causes problems like this is a messed up PATH setting. Try the command echo $PATH and report the results. If your PATH is messed up, it's probably something in your .profile, .bash_login, .bash_profile, or .bashrc files (note that these are all directly in your home folder, not your Library folder). Have you made any changes to them recently? –  Gordon Davisson Apr 13 '12 at 14:45

1 Answer 1

You've probably overwritten your PATH. Check this file* for statements with export PATH:

/Users/your-username/.bash_profile

If Sencha has made any changes to that file, note that this is the correct syntax to be used to add a folder to your PATH:

export PATH=/some/other/path:$PATH

If you forgot the :$PATH, you'll overwrite it every time you start the Terminal. Therefore, OS X won't be able to find your commands. So, the fix would be to remove offending export lines completely, or fix them to use the right syntax.

export PATH=/Users/Oskar/Sencha:$PATH

* The file is hidden by default. If you are unable to see it from Finder, and your PATH is still broken, run the following command: /usr/bin/open ~/.bash_profile to open it in a text editor.

share|improve this answer
    
Yeah something is problably wrong with my PATH, I got tis result when I tried echo $PATH: /Users/Oskar/Sencha. Maybe there was som changes made when I installed Sencha? Thank you for the answer –  user130369 Apr 26 '12 at 9:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.