Getting drush to work on my MacBook Pro...

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by benzeene on July 13, 2011 at 12:10am

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.

Categories: , , , ,

Comments

Thanks benzeene for taking

Posted by webbywe on July 13, 2011 at 7:05am

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

Agreed! I've cross-posted

Posted by christefano on July 13, 2011 at 12:18pm

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

This is the way I do it,

Posted by highermath on July 14, 2011 at 3:20am

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!

AltStyle によって変換されたページ (->オリジナル) /