Getting drush to work on my MacBook Pro...

I had the pleasure of being introduced to drush at this past meetup, and wanted to provide some detail that might serve someone else.

I run a MacBook Pro, and MAMP as a local development server.

I followed Mike's recommendation of using a path alias to the actual drush directory, so that it would be accessible from Terminal:

I placed the uncompressed drush directory in:
/Users/ben/Applications/
and ran the alias script, following Mike's recommended course of action:

"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/local/bin/drush"

So I ran in Terminal:
sudo ln -s /Users/ben/Applications/drush /usr/local/bin/drush
Entered password, Return. No complaint.
When I try the command, it complains about no such command.
I checked the /usr/local/bin/ directory and drush is there...
But no go.

So, I did the following that I got off the drupal site (JayKayAu):

  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

drush was found but getting a memory error, so I needed to edit my php.ini which was in my MAMP install directory /Applications/MAMP/config/php5.2

Didn't know how to use vi, so used Textwrangler instead (since it can see invisible files).

Edited the php.ini for both php5.2 and php5.3 directories:

  1. Changed memory_limit to 256M
  2. Changed max_execution_time = 90
  3. Changed max_input_time = 180

WORKING!

Hope this helps someone else.

Comments

Thanks benzeene for taking

williamestrada's picture

Thanks benzeene for taking the time to document and contributing back to community. Much appreciated who this will help.

Orange County PHP (OCPHP) / Orange County Drupal (OCDrupal)
http://meetup.com/oc-php / http://meetup.com/ocdrupal

Agreed! I've cross-posted

christefano's picture

Agreed! I've cross-posted this to the Drush and LA Drupal groups to help get more eyes on this.


Exaltation of Larks
Founder, CEO
http://www.larks.la  
Droplabs
Founder, Lead Burrito Analyst
http://Droplabs.net  
Downtown Drupal
Organizer, Drupal Adventure Guide  
http://DowntownDrupal.org  

This is the way I do it,

highermath's picture

This is the way I do it, which is pretty much how I do it on every box, Mac or linux:

  • I put drush in /opt/drush to keep it out of the way.
  • I give execute permissions (755) to everything that needs to be executed -- drush, drush.php, the commands, etc
  • I link /usr/local/bin/drush to /opt/drush/drush

This has provided a wealth of joy and happiness!

LA Drupal (Los Angeles Drupal)

Group events

Add to calendar

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week