1

I'm on a mac. And I user MAMP a lot. I'm pretty new to command line and I'm trying to install Drush. I see I need to install composer first (according to what I read at drush-ops, so I did. Here's the commands I put in:

my-MacBook-Pro:~ mycomputername$ curl -s https://getcomposer.org/installer | php
#!/usr/bin/env php
All settings correct for using Composer
Downloading...

Composer successfully installed to: /Users/myname/composer.phar
Use it: php composer.phar
my-MacBook-Pro:~ mycomputername$  mv composer.phar /usr/local/bin/composer
mv: rename composer.phar to /usr/local/bin/composer: Permission denied
my-MacBook-Pro:~ mycomputername$ sudo  mv composer.phar /usr/local/bin/composer
Password:

after which I did a command "composer about" to check and I got something back so I know it installed. so when i entered:

my-MacBook-Pro:~ mycomputername$ composer global require drush/drush:6.*
Changed current directory to /Users/myname/.composer
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)

- Installing drush/drush (6.2.0) Downloading: 100%

Writing lock file
Generating autoload files

...and did a "drush status" I got:

my-MacBook-Pro:~ mycomputername$ drush status
-bash: drush: command not found

...so apparently it installed but I should be able to find it. What should I do next? do i need to create and alias or what?

james
  • 707
  • 2
  • 6
  • 13

3 Answers3

2

When running drush status you should get something like this

PHP executable        :  /Applications/MAMP/bin/php/php5.5.10/bin/php      
PHP configuration     :  /Applications/MAMP/bin/php/php5.5.10/conf/php.ini 
PHP OS                :  Darwin                                            
Drush version         :  6.2.0                                             
Drush configuration   :                                                    
Drush alias files     :                                                    

I installed drush doing just this command

brew install drush

Brew is very helpful to install things in command line, I recommend you install brew. (http://brew.sh/)

Mario
  • 1,213
  • 2
  • 12
  • 37
  • 1
    I followed your suggestion and it worked I get Drush although my drush status is a little different maybe due to where it installed. Instead I got: PHP executable : /usr/bin/php PHP configuration : PHP OS : Darwin Drush version : 6.2.0 Drush configuration : Drush alias files : Will there be a problem? (thanks) – james Apr 21 '14 at 23:09
  • 1
    No problem at all. The difference is that my `drush status` referenced the php on MAMP, because I was on MAMP. Your status referenced the php installed in your computer. Glad to have helped. – Mario Apr 21 '14 at 23:15
1

Much simpler answer! Just quote the version string :) You don't need to switch to Brew from Composer.

composer global require "drush/drush:7.*"

Here's more info about using Composer to manage Drush... http://whaaat.com/installing-drush-8-using-composer

doublejosh
  • 5,548
  • 4
  • 39
  • 45
0
  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