我在mac上。我经常使用MAMP。我对命令行还很陌生,我正在尝试安装Drush。我知道我需要先安装composer(根据我在德鲁什操作中读到的内容,我照做了
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
很明显它安装了,但我应该能找到它。下一步该怎么办?我需要创建和别名吗?
当运行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/)
答案简单多了!只需引用版本字符串:)您不需要从Composer切换到Brew。
composer global require "drush/drush:7.*"
以下是有关使用Composer管理Drush的更多信息。。。http://whaaat.com/installing-drush-8-using-composer
-
将drush.tar.gz下载到您的桌面(或任何地方)
-
跳转到终端cd~/桌面
-
用提取tar-zxf drush.tar.gz
-
将其移动到/usr/local/libsudo mv drush/usr/local/lib/
-
使其可执行sudo chmod u+x/usr/local/lib/drush/drush
-
然后把它放在/usr/bin/中,这样你就可以在任何地方运行它sudo ln-s/usr/local/lib/drush/drush/usr/bin/drush