It looks like I installed Drush, following the directions in the documentation.

Here's what I did.

Jens-MacBook-Air:~ jensimmons$ composer --version
Composer version 1.0.0-alpha8 2014-01-06 18:39:59
Jens-MacBook-Air:~ jensimmons$ composer global require drush/drush:dev-master
Changed current directory to /Users/jensimmons/.composer
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing pear/console_table (1.1.5)
    Downloading: 100%         

  - Installing symfony/yaml (v2.2.1)
    Downloading: 100%         

  - Installing d11wtq/boris (v1.0.8)
    Downloading: 100%         

  - Installing drush/drush (dev-master a2c7030)
    Cloning a2c703071e2c3374e1b3855e24d29468b9069b5c

pear/console_table suggests installing pear/Console_Color (>=0.0.4)
d11wtq/boris suggests installing ext-pcntl (*)
Writing lock file
Generating autoload files
Jens-MacBook-Air:~ jensimmons$ drush help
-bash: drush: command not found

When I change directories, to inside a Drupal installation, I get the same result. drush: command not found.

What am I missing??

6 Answers 6


Try adding the following to the end of your /Users/jensimmons/.bashrc file:

export PATH="$HOME/.composer/vendor/bin:$PATH"

and then run

source $HOME/.bashrc


I just noticed there was a section in the Install/Update - Composer section of the Drush README.md file that mentions this:


It's the second point "Make sure Composer's global bin directory is on the system PATH (recommended)"

Hope that helps.

  • 1
    That did help! Thanks. I didn't have a .bashrc file, so I created one. And did both steps you listed. Now Drush runs fine. Excellent! Back to work...
    – jensimmons
    Jun 27, 2014 at 15:51
  • Hm. Wait. So I leave, quit, stop working on a thing. And come back to it later. And crush doesn't work again. If I run source $HOME/.bashrc again, it works. What can I do to make this permanent?
    – jensimmons
    Jul 8, 2014 at 18:57
  • I'm not a mac user, but you might look at matsearle.com/blog/using-bashrc-mac-osx . essentially, you need to source .bashrc from .bash_profile by adding the line if [ -f ~/.bashrc ]; then source ~/.bashrc;fi
    – Pete
    Aug 16, 2014 at 0:35

I don't know why they don't include this in the directions, but you can use symbolic link to make drush a globally executable command:

sudo ln -s /home/YOU/.composer/vendor/drush/drush/drush /usr/local/bin

This way you don't have to worry about running source $HOME/.bashrc everytime you login.

Adjust your home directory as needed. ;)

  • It's not included in the directions because if you're installing drush globally via composer it's assumed that you're using composer's method to run things, which involved getting composer's bin path into the system path. You can symlink anything you want to anywhere you want, but if you're going to do that why install globally with composer at all? Just clone the drush repo, run composer install, and add a symlink manually. There's also really no need to run source every time you login, it just needs to be in a .bash_profile or similar
    – Clive
    Sep 11, 2014 at 14:34
  • +1 this helped me, my path was slightly different for my setup, so the command I ran was: sudo ln -s /home/vagrant/.config/composer/vendor/drush/drush/drush /usr/local/bin which meant that I could run drush using just drush without needing the preceding path. Thank you! Jul 26, 2017 at 10:44

for ubuntu version

first check is your composer path is successfully added with in your environment variable,

In your terminal type evn and hit enter to check available paths. composer path should be added with in "PATH=..." variable

if composer path missing add your path by this approach

if your composer working fine then follow the steps to install latest drush

Step 1: use this cmd composer global require drush/drush:dev-master

check your drush version.


An answer to jensimmon's question in ylynfatt's answer:

Hm. Wait. So I leave, quit, stop working on a thing. And come back to it later. And crush doesn't work again. If I run source $HOME/.bashrc again, it works. What can I do to make this permanent?

(I can't post comment there, not enough points yet):

short answer: try putting in .bash_profile: source ~/.bashrc

Long answer (from my notes, can't remember original sources):

When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists.
After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable. ... When an interactive shell that is not a login shell is started, bash reads and executes commands from ~/.bashrc, if that file exists. [/etc/profile is global, the next 3 files are local. The above might change depending on how the shell is invoked, though. So...] By default, Terminal starts the shell via /usr/bin/login, which makes the shell a login shell. On every platform (not just Mac OS X) bash does not use .bashrc for login shells (only /etc/profile and the first of .bash_profile, .bash_login, .profile that exists and is readable). This is why put "source ~/.bashrc in your .bash_profile" is standard advice.



Try the following one-liner (if you've root privileges):

sudo COMPOSER_HOME=/var/lib/composer COMPOSER_BIN_DIR=/usr/local/bin COMPOSER_VENDOR_DIR=/var/lib/composer/vendor composer require drush/drush:dev-master

which would install the recent drush straight into /usr/local/bin (you can free to change COMPOSER_BIN_DIR wherever you want to install it, so composer would create a proper symbolic linking for you).

If you prefer to run it as a user, try:

COMPOSER_BIN_DIR=~/bin composer require drush/drush:dev-master

which would install the recent drush into your local ~/bin (some OS recognise this directory as having executable binaries), otherwise add the following line into your ~/.bashrc or ~/.profile:

export PATH=$PATH:$HOME/bin


Alternatively try installing Phar binary as shown below.

Download latest stable release using the command below:


sudo install <(curl http://files.drush.org/drush.phar) /usr/local/bin/drush

OS X/Unix:

sudo wget -O /usr/local/bin/drush http://files.drush.org/drush.phar
sudo chmod +x /usr/local/bin/drush

Windows and other

Download manually at https://github.com/drush-ops/drush/releases


Try adding this to .bashrc

export PATH=~/.config/composer/vendor/bin:$PATH

  • where the .bashrc located?
    – Cool
    May 29, 2017 at 18:53
  • In linux system it should be located at the home/user directory
    – Kaka Awira
    Jun 6, 2017 at 6:29
  • I'm looking in windows machine... Where it located in windows?
    – Cool
    Jun 6, 2017 at 7:33
  • For Windows it is a bit different, you need to specify environment variables. This link explains well.
    – Kaka Awira
    Jun 7, 2017 at 0:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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