32

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?

de.
  • 7,068
  • 3
  • 40
  • 69
  • 1
    I haven't found a workaround yet either, but I'm encountering the exact same issue :( Apparently, homebrew got rid of the `switch` command very recently: https://github.com/Homebrew/discussions/discussions/339 – reesaspieces Feb 08 '21 at 09:56
  • 10
    I am having this exact same problem. And this seems like a poor decision on Homebrew crews part to remove switch with no "hey use this instead" error..sigh. – thefonso Mar 08 '21 at 04:01

3 Answers3

29

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/openssl@1.0

If you're installing openssl@1.0 for Ruby purposes, this thread tells you how to do that as well. For example:

CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl@1.0)" RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl@1.0)" rbenv install 2.7.2
reesaspieces
  • 1,600
  • 4
  • 18
  • 47
0

Brew disabled "switch" command. Use "link" instead:

brew link openssl@1.1
Seralto
  • 1,016
  • 1
  • 16
  • 30
-3

I just used sudo:

sudo brew switch dart 2.16.0

and close the vs code and start again. That's it and run without any errors.