RuntimeException when running drush commands in root folder I am setting up a local site for development on a ubuntu server 18.04 VM.
I pull our repo into my windows machine and then mount this onto the VM as a shared folder.
I run composer install and it finishes completely, but when I go to my site's docroot folder and run
drush st or drush cr, I get the following error message:
RuntimeException: Drush::$container is not initialized yet. \Drush::setContainer() must be called with a real container. in Drush\Drush::getContainer() (line 151 of /media/sf_anothercnas2/vendor/drush/drush/src/Drush.php).
Drush command terminated abnormally due to an unrecoverable error.

Drupal installation went through successfully. In my composer.json,
I have &quot;drush/drush&quot;: &quot;9.7.2&quot;
Composer show confirms that the local drush version installed is 9.7.2 but when I run
drush --version, it returns 8.1.16
I still am not sure why I'm getting the RuntimeException, but I can work around this issue by running
vendor/drush/drush/drush st //or any other drush 9 commands