Ugh. Drush 9 can only be installed using composer require. Drush 8 can no longer be installed via homebrew (they removed it!) Soooo, here's how to set up Drush Launcher, which will use the Drush 9 you install in Drupal 8 projects using composer require, but fall back to a globally installed Drush 8 for old Drupal 7 projects.
Pantheon's Terminus is NOT currently compatible with Drush 9. If you have it installed in your project and you try to use terminus remote:drush
your world will be a sad, sad place as your drush command goes down in flaming php-error wreckage...
So for now, just install Drush 8 globally. Rename the drush.phar to drush, and don't mess around with the rest of this till the Pantheon folks get this dealt with!
cd
in the terminal window and then drag the folder that contains the drush.phar file from the finder onto the terminal window and drop it. Then hit enter.)chmod +x drush.phar
sudo mv drush.phar /usr/local/bin/drush.phar
chmod +x drush.phar
drush
calls the Drush Launcher: sudo mv drush.phar /usr/local/bin/drush
export DRUSH_LAUNCHER_FALLBACK=/usr/local/bin/drush.phar
drush self-update
composer require drush/drush
Now just use drush
as you used to in days of yore; if you're in a Drupal 8 project with Drush 9 installed locally, the Drush Launcher will find Drush 9 in the vendors folder and use it. Otherwise, the Drush Launcher will fall back to the global Drush 8 install