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 am new to OS X and was following a video and typed

export PATH="$HOME/opt/git/bin:$PATH" 

I believe this messed up my path and I am not able to install MySQL now.

When I tried to install Homebrew I get

-bash: homebrew: command not found.  

I tried restarting the terminal. How can I correct this?

share|improve this question
add comment

1 Answer 1

Where did you get the export line from?

First things first: Look into your home folder (e.g. open a Finder window). Is there really a folder called opt in there? If yes, something's really messed up. If no, your export command was just wrong, since there's no opt under $HOME (which is your user's home folder). /opt is typically at the root level of the file system.

Is there a folder called /opt? Open a Terminal and enter ls /opt. Does this directory exist? If yes, then you're probably using another package manager already and should not install Homebrew.

But even then, if /opt really exists, there shouldn't be /opt/git/bin.

If you really want to install a new version of Git, you can do that with:

  • the git-osx-installer, which will install everything to /usr/local/git/
  • through Homebrew with brew install git, see below, which will install the git command to /usr/local/bin/

To install Homebrew, you have to follow the instructions. There is no homebrew command. You also don't have to change your PATH.

You just have to copy and paste this to your Terminal:

/usr/bin/ruby -e "$(/usr/bin/curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"

This will install Homebrew, but make it available under the brew command. So to install MySQL through Homebrew, you'd enter:

brew install mysql
share|improve this answer
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.