跳转到主要内容
mahonghong 提交于 25 April 2015
原文章:     http://osseed.com/blog/install-drush-manually-mac-os                  http://log.itto.be/?p=1127.

这篇文章找了2篇文章. 第一个链接帮我成功的安装了Drush 在 Mac 上. 第二个链接帮我解决了 Drush 很多功能不能用, 比如说 drush en 手动安装 Drush 的步骤:     1)    下载 Drush 文件, https://github.com/drush-ops/drush     2)    解压缩, 然后将文件夹复制到 /usr/local/lib 文件夹下 (如果路径不存在, 请自己创建)     3)    这一步需要给 drush 可以执行的权利, 简单的复制后面的命令到 terminal 即可:    sudo chmod u+x /usr/local/lib/drush/drush     4)    现在尝试运行一下 Drush 是否能正常工作    /usr/local/lib/drush/drush     5)    如果运行上面的命令出现后面的错误, "#ff0000;">"Unable to load autoload.php. Drush now requires Composer in order to install its depedencies and autoload classes. Please see README.md" 请使用下面的方法解决:         a)    将下面的命令一条一条的在终端中运行.             1)    在 drush 的目录下, 运行:    curl -sS https://getcomposer.org/installer | php             2)    php composer.phar         b)    然后还是在 drush 的目录下, 运行:    sudo php composer.phar install     6)    我们解决了上面的问题后, 尝试用后面的命令运行 drush:    /usr/local/lib/drush/drush (作者还挺调皮的说,一定会能用的)     7)    最后一步, 创建连接:    sudo ln -s /usr/local/lib/drush/drush /usr/bin/drush     8)    完成!     以上安装完后,可以正常在任何位置使用 drush 命令. 不过对于 XAMPP or MAMP 用户, 他们会发现无法正常使用 drush en 启动模块. 所以附上下面的解决办法:     当你在使用 drush en 的时候会看到如下错误:         Drush: “Command pm-enable needs a higher bootstrap level to run” When running drush you can run into this error message. In my case, the mysql command line tool provided with Mamp Pro was not available. You can easily test this by typing the command ‘mysql’ in terminal. Your output might be -bash: mysql: command not found.

    解决方法:    sudo nano ~/.bash_profile         1)    XAMPP 用户添加:    export PATH=/Applications/XAMPP/xamppfiles/bin/:$PATH         2)    MAMP  用户添加:    export PATH=/Applications/MAMP/Library/bin/:$PATH     然后用后面的命令重新加载一下:    source ~/.bash_profile  

Drupal 版本