12

I am running Drush version 6.2.0 and the latest Drupal 8 beta on Dreamhosters. When I run drush cc all within the sites directory, I receive the following error immediately after executing the command:

Fatal error: Class 'Drupal\Core\Session\AccountInterface' not found in /home/mywebsite/mywebsite.com/core/includes/bootstrap.inc on line 63 Drush command terminated abnormally due to an unrecoverable error.

Error: Class 'Drupal\Core\Session\AccountInterface' not found in /home/mywebsite/mywebsite.com/core/includes/bootstrap.inc, line 63

Why does it happen? How can I fix this?

12

Drush 6 does not support Drupal 8. You must use drush 7.0-rc1 with Drupal 8 beta 9, or drush master head with Drupal 8 head.

UPDATE: Drush 7 no longer supports Drupal 8; now, use Drush 8 with Drupal 8.

9

If you are using Drush 8 with Drupal 8 and still getting this error... Please make sure path is correct. For me it worked after setting path variable as:-

export PATH="$HOME/.composer/vendor/bin:$PATH"
  • Thanks! I had landed in this post with a similar problem (when using drush site-install with a local Drush 8 to install Drupal 8) and setting the path to composer/vendor/bin worked fine. – dinopmi Dec 18 '15 at 14:37
  • Awesome! After a Drush reinstall, this turned out to be a much simpler fix. – MadPhysicist Oct 27 '16 at 18:44
  • vote up, work for me too – Yusef Nov 12 '16 at 22:41
  • Where do I add this code ? – logeshvaran Feb 8 '17 at 7:59
0

As for Drupal 8, drush cc all is no longer the way to clear cache, use drush cr instead:

`cache-clear all` is deprecated for Drupal 8 and later. Please use the `cache-rebuild` command instead.                                                                  [error]
0

I ran into the same error using Drush 5.10.0 from a previous Drupal 7 project. If you have composer installed globally you can upgrade Drush to the latest version using:

$ composer global require drush/drush:dev-master

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.