Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drush upgrade error: Unable to load class \Drush\VersionControl\Backup #5

Open
laceysanderson opened this issue May 17, 2021 · 2 comments

Comments

@laceysanderson
Copy link
Member

This error happens when trying to upgrade either Drupal core or extension modules using Drush in the Tripal Crop Docker. It's caused due to Drush being installed locally in the docker image.

Solution

We need to remove the local Drush installation, install Drush globally and add an alias to the drush command.

docker exec --workdir=/var/www/html tcrop composer remove drush/drush
docker exec tcrop composer global require drush/drush:8.x
docker exec tcrop ln -s /root/.composer/vendor/bin/drush /usr/bin/drush

Reasoning/Background

Originally, Drush 8 was installed via composer because the Drush documentation says the following (Drush docs):

Drush only supports one install method. It requires that your Drupal site be built with Composer and Drush be listed as a dependency.

Since Drush 8 is the most recent version of Drush to support Drupal 7, we chose it and used these instructions. However, it has since become known that a local install of Drush via composer for Drupal 7 (Issue #4734) causes an error when updating Drupal core. This was fixed in a more recent version of Drush but they are incompatible with Drupal 7.

@lilicamd
Copy link

Thank you for the documentation, it worked great for me!

@jlariza
Copy link

jlariza commented Jun 2, 2021

Thank you! it worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants