drupal 7 – Después de instalar composer: "No se pudo encontrar el comando drush X"

Pregunta:

Editar: reescribí el párrafo de introducción para resaltar la instalación del compositor; sospecho que el compositor puede haber roto drush.

Quiero probar la búsqueda elástica con D7. Usé drush para instalar una nueva instalación de D7, luego vistas, elasticsearch_connector, bibliotecas. En ese momento, Watchdog indicó que me faltaba la biblioteca elasticsearch-php.

Intenté seguir las instrucciones de Elasticsearch para obtener esta biblioteca e instalar el compositor:

/sites/mysite $ curl -sS https://getcomposer.org/installer | php
#!/usr/bin/env php
All settings correct for using Composer
Downloading...

Composer successfully installed to: /sites/aarp/composer.phar
Use it: php composer.phar
/sites/mysite $ sudo mv composer.phar /usr/local/

~/.profile un alias para compositor a mi ~/.profile . No he podido usar ningún comando de drush desde (ver más abajo). Desde entonces, descubrí que el compositor se puede usar para instalar drush, así que ahora sospecho que esta es la raíz de mi problema.

/sites/mysite $ drush en composer_manager -y
composer_manager was not found.                                                                                                                                        [warning]
The following projects provide some or all of the extensions not found:                                                                                                [ok]
composer_manager
Would you like to download them? (y/n): y
cProject composer_manager (7.x-1.7) downloaded to sites/all/modules/composer_manager.                                                                                   [success]
dThe following extensions will be enabled: composer_manager
Do you really want to continue? (y/n): y
composer_manager was enabled successfully.                                                                                                                             [ok]
One or more extensions have dependencies managed by Composer.
Update packages managed by Composer? (y/n): y
Download and install the Drush Composer extension? (y/n): y
Directory /Users/mmutrux/.drush exists, but is not writable. Please check directory permissions.                                                                       [error]
Project composer (8.x-1.x-dev) could not be downloaded to /Users/mmutrux/.drush/composer.                                                                              [error]
The drush command 'composer' could not be found.                                                                                                                       [error]
/sites/mysite $ chgrp _www /Users/m
macadmin/ mmutrux/  
/sites/mysite $ chgrp _www /Users/mmutrux/.drush/
chgrp: you are not a member of group _www
/sites/mysite $ chgrp _www /Users/mmutrux/.drush/
/sites/mysite $ chmod 777 /Users/mmutrux/.drush/
chmod: Unable to change file mode on /Users/mmutrux/.drush/: Operation not permitted
/sites/mysite $ sudo chmod 777 /Users/mmutrux/.drush/
Password:
/sites/mysite $ drush en composer_manager -y
The drush command 'en composer_manager' could not be found.  Run `drush cache-clear drush` to clear the commandfile cache if you have installed new extensions.        [error]
/sites/mysite $ drush cache-clear drush
The drush command 'cache-clear drush' could not be found.  Run `drush cache-clear drush` to clear the commandfile cache if you have installed new extensions.          [error]

¿A dónde fue mi drush?

Editar: agregado en respuesta a los comentarios

/sites/mysite $ which drush
/opt/local/bin/drush
/sites/mysite $ drush --version
The drush command 'version' could not be found.  Run `drush cache-clear drush` to clear the commandfile cache if you have installed new extensions.                    [error]
/sites/mysite $ sudo drush --version
The drush command 'version' could not be found.  Run `drush cache-clear drush` to clear the commandfile cache if you have installed new extensions.                    [error]
/sites/mysite $ drush --version -v
Initialized Drupal 7.35-dev root directory at /sites/aarp                                                                                                                 [notice]
Initialized Drupal site default at sites/default                                                                                                                          [notice]
The drush command 'version' could not be found.  Run `drush cache-clear drush` to clear the commandfile cache if you have installed new extensions.                    [error]

Respuesta:

No estoy seguro de si esto ayudará a alguien, pero si alguna vez se encuentra con este problema:

Esto parecía ser un problema de permisos desde el principio, por lo que en el chat:

  • Se eliminaron las antiguas instancias de drush y composer.
  • Compositor instalado
  • Drush descargado de Github
  • Dependencias instaladas a través de Composer

Una vez que tuvimos una copia nueva de drush, parece que drush ahora funcionó bien. Tuvimos algunos pequeños problemas que vinieron de la máquina que se estaba utilizando.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top

web tasarım