1

I used brew install drush which installed the latest stable version (6.1), when I need the 5.x branch.

This GitHub issue indicates a drush 5.x package was made available for homebrew, but I'm unsure how to install it.

3 Answers 3

3

Homebrew install specific version of formula? - this answer on drupal.stackexchange might help you to get the overview of how specific formulas can be installed via homebrew.

Short version related to your specific question:

  1. Update homebrew with brew update.
  2. Get all the versions available for drush formula with brew versions drush
  3. You will see a list of commits that point to specific drush versions, e.g.,

    6.1.0    git checkout a188056 Library/Formula/drush.rb
    6.0.0    git checkout 1264aaf Library/Formula/drush.rb
    6.0-rc4  git checkout 39b2450 Library/Formula/drush.rb
    6.0-rc2  git checkout 2a61472 Library/Formula/drush.rb
    6.0-beta1 git checkout 54ba68d Library/Formula/drush.rb
    5.9      git checkout 81108ad Library/Formula/drush.rb
    5.8      git checkout 91cb127 Library/Formula/drush.rb
    
  4. Go to the base brew directory by typing cd $( brew --prefix )

  5. Uninstall your current drush installation with brew uninstall drush (this won't affect your settings in ~/.drush directory).
  6. Checkout the drush formula for specific commit that you are interested in. If you want to have drush version 5.9, type git checkout 81108ad Library/Formula/drush.rb and you will have a brew formula available for this particular version.
  7. Install drush (version 5.9) with brew install drush
  8. Type drush --version to make sure you have the correct version installed.
2

The standard way to install drush is via pear.

You can install a specific version using the following command:

pear channel-discover pear.drush.org
pear install drush/drush-5.9.0

Available versions can be found on the Drush pear page: http://pear.drush.org/

2

If you have the most up-to-date version of Homebrew, you can use the brew switch command. For example in my terminal I switched to 5.9, then back to 6.2:

KTaylor$ brew switch drush 5.9
Cleaning /usr/local/Cellar/drush/5.8
Cleaning /usr/local/Cellar/drush/5.9
Cleaning /usr/local/Cellar/drush/6.0-beta1
Cleaning /usr/local/Cellar/drush/6.0-rc2
Cleaning /usr/local/Cellar/drush/6.1.0
Cleaning /usr/local/Cellar/drush/6.2.0
2 links created for /usr/local/Cellar/drush/5.9

KTaylor$ brew switch drush 6.2.0
Cleaning /usr/local/Cellar/drush/5.8
Cleaning /usr/local/Cellar/drush/5.9
Cleaning /usr/local/Cellar/drush/6.0-beta1
Cleaning /usr/local/Cellar/drush/6.0-rc2
Cleaning /usr/local/Cellar/drush/6.1.0
Cleaning /usr/local/Cellar/drush/6.2.0
2 links created for /usr/local/Cellar/drush/6.2.0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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