Please follow these steps:

Navigate to http://brew.sh/

Copy the Code :

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Paste that code at a Terminal prompt

Press Return/Enter

Press Return again

Enter your computer Password

Downloading and Installing HomeBrew message