0

I had Drush working yesterday and was able to use it to download a copy of Drupal. After shutting down my machine last night it now won't work.

which drush does nothing today. drush help gives: -bash: drush: command not found

I guess that when I installed it yesterday, some setting was live in the terminal allowing it to work, but this wasn't saved or stored so after restarting it doesn't work. On the day drupal was installed I closed and reopened the terminal window several times and Drush kept working.

I can still see my copy of 6.5.0 in $Trotter/.composer/vendor/drush/drush/

The installation instructions say:

Now add Drush to your system path by placing export PATH="$HOME/.composer/vendor/bin:$PATH" into your ~/.bash_profile (Mac OS users)

I followed these instructions on creating a bash profile and have saved my bash profile with the single line in it: export PATH="$Trotter/.composer/vendor/bin:$PATH"

Following the instruction below in terminal didn't do anything for me:

Type ". .bash_profile" to reload .bash_profile and update any functions you add

Please suggest what I need to do to get Drush working again, and keep working after restarting the machine.

Here is the location of composer inside my home directory: location of .composer

2
  • what is the output of this command in a terminal: whereis drush;
    – munkiepus
    Commented Mar 24, 2015 at 10:45
  • Hi munkiepus. which drush or whereis drush in terminal just goes to a new line with a new command prompt. No feedback is given. Commented Mar 24, 2015 at 10:59

1 Answer 1

1

The use of $username in the path looks a bit suspect. You should use .bash_profile for mac as as .bashrc seems not to be auto loaded. There usually isn't a /username/ directory, its usually /home/username/ so your path should probably be:

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

then execute this to load the file:

source .bash_profile

or open a new terminal

4
  • Sorry munkiepus - I can see how me writing $Username could be confusing (I probably should have used $HOME). I originally did that to try to make the question more universal, but to add clarity I have used my actual home directory name and a screenshot of the location of .composer Commented Mar 24, 2015 at 14:26
  • I have tried running source .bash_rc in terminal from a variety of locations, including from my home directory where the .bash_profile is. Each time I get -bash: .bash_rc: No such file or directory Commented Mar 24, 2015 at 14:36
  • echo $Username and echo $Trotter do nothing and just give a new command prompt. echo $Shell returns /bin/bash. And ls ~/.composer/vendor/bin returns drush drush.complete.sh drush.bat drush.php Commented Mar 24, 2015 at 14:39
  • Ah mac doesn't load .bashrc automatically, you could put it in your .bash_profile and mac should still respect $HOME (forget about $Trotter). Put this in your .bash_profile and open a new terminal or source .bash_profile export PATH="$HOME/.composer/vendor/bin:$PATH"
    – munkiepus
    Commented Mar 24, 2015 at 15:14

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.