Edit: ignore this post! The instructions in README.txt were fine, I just wasn't following them closely enough!

I'm having real problems installing Drush on my local Mac OS X machine, which I use with XAMPP as a testing environment for Drupal. I've tried my best to install it (following the instructions in README.txt) but I can't get it to work. I'm no exactly a wizard at the command line.

Here's what I do:

1: Download the drush.tar.gz file to the desktop.
2: Double-click on th .tar.gz file to decompress it. This creates the drush folder.
3: Move the drush folder to /usr/local/lib/, which I've read is a good place to have it.
4: Open up a terminal window and type

cd /usr/local/lib/drush

5: As per the instructions in README.txt, I type

chmod u+x /usr/local/lib/drush/drush

6: At this point I'm expecting to be able to go into the drush folder and type "drush" to at least get some kind of help file: but typing drush just gives me:

-bash: drush: command not found

Any idea what I'm doing wrong?

Comments

vm’s picture

my reading of the readme.txt it does state to put drush in /usr/local/lib

it states to create a link, which I assume is a symlink or the optional path.

For Linux/Unix/Mac:
1. Untar the tarball into a folder outside of your web site (/path/to/drush)
2. Make the 'drush' command executable:
$ chmod u+x /path/to/drush/drush
3. (Optional, but recommended:) To ease the use of drush,
- create a link to drush in a directory that is in your $PATH, e.g.:
$ ln -s /path/to/drush/drush /usr/bin/drush
OR
- create an alias to drush:
$ alias drush='/path/to/drush/drush'
(this goes into .profile or .bash_aliases in your home folder)

abelb’s picture

im somewhat new to the command line as well, I don't have a lib directory in local. my lib directory is on the same level as local.
Is this the directory i should put it in?

when i tried, i did not have permissions.
I'm guessing it really doesn't matter where you put it but there is a preferred place and that is /usr/local/lib/drush

can i put it in /usr/local/bin? that is where i have wget

I'm also confused about where i put the bash alias

create an alias to drush:
       $ alias drush='/path/to/drush/drush'
       (this goes into .profile or .bash_aliases in your home folder)

how do i find this file on Mac OSX?

thanks for any help! i really want to save some time installing modules!

andrea

JayKayAu’s picture

Hey kids!

This is what I did, and it works beautifully (most if it is the same as above):

1. Download drush.tar.gz to your desktop (or wherever)

2. Jump across to the Terminal
cd ~/Desktop

3. Extract it with
tar -zxf drush.tar.gz

4. Move it to /usr/local/lib
sudo mv drush /usr/local/lib/

5. Make it executable
sudo chmod u+x /usr/local/lib/drush/drush

6. Then stick it in /usr/bin/ so that you can run it from anywhere
sudo ln -s /usr/local/lib/drush/drush /usr/bin/drush

Hope this helps someone :D

eriknewby’s picture

Thanks JayKayAu! That did it for me. :)

aerozeppelin’s picture

Thank you this worked for me!

ntrepid8’s picture

This worked great!

danny englander’s picture

Thanks, really great instructions, much appreciated! :)

Havind-1’s picture

Thank you JayKayAu it's work all good

koenvandenbossche’s picture

Thank you very much for your support! :)

csmcreative’s picture

That worked great. Since I am on Lion, I just did /usr/lib/ and it works now. Much appreciated!
Chris

delacosta456’s picture

hi
I confirm.. very nice for me too

thanks

Diegen’s picture

this worked for me.

using osx 10.6 - leopard

i downloaded drush and put it in my home folder. thus to access drush I would have to type:

drush/drush to get a response from drush.

click on your Macintosh HD icon, then press SHIFT COMMAND G which opens your GO to folder dialogue. Enter usr and press enter. You should now see the folders "bin" and "lib". This was helpful to me since I do not have a "local" folder inside "lib" i.e my lib path looks like this: lib/bin/drush and not lib/local/bin/drush.

With my structure of the lib directory confirmed, simply copy drush to your lib/bin directory anduse terminal to enable write permissions:

chmod u+x /usr/bin/drush

then the last step:

sudo ln -s /usr/lib/drush/drush /usr/bin/drush

thats it.

Funkwarrior’s picture

Thank you Diegen, works for me!

but I use this sequence:

$ tar -zxf drush.tar.gz
$ sudo mv drush /usr/lib/
$ chmod u+x /usr/lib/drush
$ sudo ln -s /usr/lib/drush/drush /usr/bin/drush

Thank you again!

Diegen’s picture

Cool

yurtboy’s picture

thanks

clintthayer’s picture

Worked as well. Many thanks.

KrisBulman’s picture

yep, did the trick, except i used

$ tar -xzvf drush-version.tar.gz
$ sudo mv drush /usr/lib/
$ chmod u+x /usr/lib/drush/drush
$ sudo ln -s /usr/lib/drush/drush /usr/bin/drush

richard.c.allen2386’s picture

Worked for me. OSX 10.7

betovarg’s picture

I get this on the last step (sudo ln -s /usr/lib/drush/drush /usr/bin/drush)

ln: /usr/bin/drush: File exists

And still cant use when typing just "drush"
Can someone give me a hand?
thnx

betovarg’s picture

After actually understanding what all the commands do, it came to me that i do not have the usr/local folder, so i installed it changing the paths:

Move it to /usr/lib
sudo mv drush /usr/lib/

Make it executable
sudo chmod u+x /usr/lib/drush/drush

Then stick it in /usr/bin/ so that you can run it from anywhere
sudo ln -s /usr/lib/drush/drush /usr/bin/drush

and... everything works now.

josmera01’s picture

In my function as follows:
1. Download drush.tar.gz to your desktop (or wherever)
2. Extract it with
3. Move it to /usr/local/lib
4. Make it executable
5. Then stick it in /usr/bin/ so that you can run it from anywhere
sudo ln -s /usr/local/lib/drush/drush /usr/bin/drush
I recommend you be as root Board Index

arthipesa’s picture

I am trying to install it on my PPC, but somehow it shows Parse error: parse error in /usr/local/lib/drush/includes/environment.inc on line 517 Help!

killerpoke’s picture

You may be interested in homebrew. Drush is supported by brew, so the only thing I had to do was typing:

brew install drush

http://mxcl.github.com/homebrew/

cbladd’s picture

nice

kclarkson’s picture

@killerpoke

Thanks for the Brew :)

This will make life much easier when I have to update Drush.

Thanks !!

Kaleem S. Clarkson
www.kaleemclarkson.com

hanamizuki’s picture

I wrote a post about this, thanks for the information above.

http://miss-hana.com/drupal-install-drush-on-maclinux/

Ganganation’s picture

I had the same problem. I adjusted the previous called solution.
But I got the following error: Could not open input file: /usr/lib/php/drush/drush.php

After reading this I realised I had to move the stuff from /usr/local/lib/drush to /usr/lib/php/drush/
Using the following command:

#sudo mv /usr/local/lib/drush /usr/lib/php/drush

This worked for me. Hope this helps!

ain’s picture

I used MacPorts and with a PEAR quickfix it worked out fine, see the few easy steps at Installing Drush on Mac OS X the developer way.

Anonymous’s picture

Thank you. Works great.

Eneay001’s picture

Works fine. Thank you.

zgjsa’s picture

I'm running MAMP 2.2 on an Mac OS 10.9.1 and have installed Drush (Master). When running any drush commands, I get no output, response, results or error messages. It returns to the command prompt. After running a drush command, I am unable to run any other terminal commands except for exit and cd, and I am only able to cd into a previous directory.

Is this a bug, a result of me not installing correctly or something else entirely? Any help would be greatly appreciated.

jaypan’s picture

When you say Drush (Master) do you mean the Master branch of the git repository? If so, you should use one of the stable branches for a start.

Contact me to contract me for D7 -> D10/11 migrations.