1

我在Mac上。我经常使用 MAMP。我对命令行很陌生,我正在尝试安装 Drush。我看到我需要先安装作曲家(根据我在 drush-ops 阅读的内容,所以我这样做了。这是我输入的命令:

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:

之后我做了一个命令“composer about”来检查,我得到了一些东西,所以我知道它已经安装了。所以当我进入时:

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)

- 安装 drush/drush (6.2.0) 下载:100%

Writing lock file
Generating autoload files

...并做了一个“匆忙状态”,我得到了:

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

...所以显然它已安装,但我应该能够找到它。接下来我该怎么办?我需要创建和别名还是什么?

4

3 回答 3

2

跑步时drush status你应该得到这样的东西

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     :                                                    

我安装了 drush 只做这个命令

brew install drush

brew 对在命令行中安装东西很有帮助,我建议你安装brew(http://brew.sh/)

于 2014-04-21T17:53:16.303 回答
1

更简单的答案!只需引用版本字符串 :) 您无需从 Composer 切换到 Brew。

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

以下是有关使用 Composer 管理 Drush 的更多信息... http://whaaat.com/installing-drush-8-using-composer

于 2015-09-29T01:56:44.460 回答
0
  1. 将 drush.tar.gz 下载到您的桌面(或任何地方)

  2. 跳转到终端 cd ~/Desktop

  3. 用 tar -zxf drush.tar.gz 解压

  4. 将其移动到 /usr/local/lib sudo mv drush /usr/local/lib/

  5. 使其可执行 sudo chmod u+x /usr/local/lib/drush/drush

  6. 然后将其粘贴在 /usr/bin/ 中,以便您可以从任何地方运行它 sudo ln -s /usr/local/lib/drush/drush /usr/bin/drush

于 2016-09-09T19:52:56.123 回答