Fatal error – failed opening /drupal/console-core/src/constants.php when calling Drush via an alias on an Acquia site

OK.  So I’m on my dev machine – I’ve added Drupal console to the code with:

$ composer require drupal/console:~1.0 –prefer-dist –optimize-autoloader

Then pushed the code up to Acquia – and when trying to run a Drush command on the Acquia cloud I get:

kbailey@jessie2:~/docroots/testgeo/docroot$ drush @testgeo.dev status
require(/mnt/www/html/testgeogcpshcc3ar/docroot/vendor/composer/../drupal/console-core/src/constants.php): failed to open stream: No such file or directory autoload_real.php:66 [warning]

Fatal error: require(): Failed opening required ‘/mnt/www/html/testgeogcpshcc3ar/docroot/vendor/composer/../drupal/console-core/src/constants.php’ (include_path=’.:/usr/local/php5.6/lib/php’) in /mnt/www/html/testgeogcpshcc3ar/docroot/vendor/composer/autoload_real.php on line 66
Drush command terminated abnormally due to an unrecoverable error.

Turns out the way to fix it is to remove ‘vendor’ from the .gitignore file.  Add, commit and push.  The alias drush command now works for me – not sure why – but thought it was worth sharing.

Share Post :

Leave a Reply