drush-ops / drush-launcher

A small wrapper around Drush for your global $PATH.
GNU General Public License v2.0
237 stars 50 forks source link

Could not find Drupal in the current path #12

Closed alexhass closed 7 years ago

alexhass commented 7 years ago

Tried v 0.2.2 and 0.2.4, but everytime I run drush --version I get a message

/srv/www/foo# drush --version Drush Shim Version: 0.2.2 Could not find Drupal in the current path.

That is the path where Drupal is...

weitzman commented 7 years ago

Right now, you have to launch your drush commands from your drupal project, or pass in the project's path via --root=/path/to/drupal. If you are already in the Drupal root, then I dont know what could be wrong. Try with --debug.

alexhass commented 7 years ago

This outputs are not helpful... this is Drupal 7.54 in the root folder.

root@foo:/srv/www/web1/html# drush --debug
Drush Shim Version: 0.2.4
ROOT: /srv/www/web1/html
Could not find Drupal in the current path.
root@foo:/srv/www/web1/html# drush --root=/srv/www/web1/html
Could not find Drupal in the current path.
root@foo:/srv/www/web1/html# drush --debug --root=/srv/www/web1/html
Drush Shim Version: 0.2.4
ROOT: /srv/www/web1/html
Could not find Drupal in the current path.
root@foo:/srv/www/web1/html# ls
CHANGELOG.txt      INSTALL.pgsql.txt   LICENSE.txt      UPGRADE.txt    files      install.php  profiles  themes      xmlrpc.php
COPYRIGHT.txt      INSTALL.sqlite.txt  MAINTAINERS.txt  authorize.php  includes   misc         scripts   update.php
INSTALL.mysql.txt  INSTALL.txt         README.txt       cron.php       index.php  modules      sites     web.config
root@foo:/srv/www/web1/html#

How can we debug this? Cannot run without drush :)

weitzman commented 7 years ago

I have only used the shim with drupal 8 and a site-local drush installed. if you dont have a site local drush, you cant use this shim; call drush directly.

webflo commented 7 years ago

@yamlfd Is you D7 site build with composer?

alexhass commented 7 years ago

This is what I found somewhere as installation guide:

composer require drush/drush
composer require drush/config-extra
wget https://github.com/webflo/drush-shim/releases/download/0.2.4/drush.phar
# Rename to `drush` instead of `php drush.phar`. Destination can be anywhere on $PATH. 
chmod +x drush.phar
mv drush.phar /usr/local/bin/drush

Now followed http://docs.drush.org/en/8.x/install/#installupgrade-a-global-drush and this works.

weitzman commented 7 years ago

FYI, The Drush 8 docs that you link to dont mention this project at all. Only Drush master docs do.