To those wishing to install Drush on their Mac, but having difficulty, here's a surefire way to get it running great:
[Edit: Umm... instead of doing all the steps below, you can use Homebrew (the 'missing package manager for Mac OS X') and enter $ brew install drush
. Much simpler!]
- Fire up the Terminal (this is why you're using Drush, so you'd better get comfy in here!).
- cd to your Desktop, download drush, and extract it.
$ cd Desktop $ wget http://ftp.drupal.org/files/projects/drush-6.x-3.3.tar.gz $ tar -xvzf drush-6.x-3.3.tar.gz
- Move the drush directory to /usr/local/lib
$ sudo mv drush /usr/local/lib
- Make drush executable.
$ sudo chmod u+x /usr/local/lib/drush/drush
- Make a symbolic link to drush in /usr/bin
$ sudo ln -s /usr/local/lib/drush/drush /usr/bin/drush
- Set up an alias in your bash environment so you can type 'drush command' rather than '/usr/bin/drush command'
$ cd ~
$ nano .profile
# Inside the .profile file:
alias drush='/usr/bin/drush'
# Then press control-O + return to write the file, and control-X to exit nano
$ source .profile
Now, you can simply enter 'drush command' to use drush.
Comments
An even easier solution is to use Homebrew. Just type "brew install drush"
I described this in an article last week on my own blog.
http://www.drupalcoder.com/story/835-easily-install-drush-on-mac-os-x-u…
Woah! Nice. I'm going to start using brew... simple as apt, yum, etc. :D
I was going to mention Homebrew. Also, wget is not installed out of the box with Snow Leopard, so your suggested method will fail. And, adding /usr/local/bin to your PATH means that "drush" will just work -- aliases can cause issues if you end up trying to run drush with system users other than your own.
I didn't think about that... many of my assumptions are based upon the fact that I'm the only one that ever uses my Macs :D
I will update the guide accordingly... but Homebrew looks to be the best solution by far. I used to use fink, but hated configuring it. Homebrew solves the config problems, and then some.
You can even use homebrew to easily build a lamp stack for dev environment using snow leopard's built in apache.
Check my blog for details though the homebrew install instructions might need a bit of an update (http://boztek.net/blog/2010/02/02/updated-install-php-52-stack-source-m…)
While I was excited to find a possible replacement for MacPorts, the installation instructions for HOMEBREW strongly suggest that you delete the "/usr/local/include" and "/usr/local/lib" directories. On my system both of these directories contain "stuff" and it seemed easier to simply follow these directions for installation than invest the time in a painful recovery because something was dependent upon a file in this directory.
I was able to successfully install Drush using these instructions in 2 minutes (THANKS!). I'm off to doing work now, but I'm curious if I was too conservative in choosing not to install HOMEBREW.
I don't use Homebrew on all my Macs. Just those that require more than a few packages over time. For my main mac, I actually just install binaries manually (and create the links like I outline in this article).
There's also another way to set up Drush on Mac using MacPorts and PHP PEAR, see Installing Drush on Mac OS X the developer way.