Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uncommon homebrew error: "Unknown command: switch"

I am in the process of trying to restart some legacy project that demands the use of an older version of openssl.

I have found good input on the issue here, which worked on one of my machines but not the other, which gives me the following error:

$  brew switch openssl 1.0.2t
Error: Unknown command: switch

The error does not seem to be very common, nothing helpful is showing up on a google/stackoverflow search.

What I have tried so far:

  • resolved all warnings shown by brew doctor
  • run brew update && brew upgrade
  • updated Xcode Command Line Tools
  • reinstalled openssl

What can I do to fix this?

like image 395
de. Avatar asked Feb 06 '21 22:02

de.


1 Answers

As I commented above, Homebrew got rid of the switch command entirely, which is why it says "Unknown command".

But rbenv provides a tap that you can install openssl from. You can run the command below:

brew install rbenv/tap/[email protected]

If you're installing [email protected] for Ruby purposes, this thread tells you how to do that as well. For example:

CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix [email protected])" RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix [email protected])" rbenv install 2.7.2
like image 61
reesaspieces Avatar answered Nov 17 '22 18:11

reesaspieces