1

One of the projects that I've been working has a dependency on ruby@2.3.

I'm using a Mac and the version of Ruby that I used for other projects is the 2.5.

I want to temporarily switch from 2.5 to 2.3 using brew. I don't want to use neither rbenv nor rvm.

1. I've installed the 2.3.7 version, using brew:

bf-old> brew install ruby@2.3 Warning: ruby@2.3 2.3.7 is already installed and up-to-date To reinstall 2.3.7, run `brew reinstall ruby@2.3

2. I'm trying to switch to it, but it's not working:

bf-old> brew switch 2.3.7 Error: 2.3.7 not found in the Cellar.

What can I do about this?

Jonathan Soifer
  • 2,715
  • 6
  • 27
  • 50
  • 1
    Why don't you want to use established mechanisms (although I currently prefer asdf) for switching? It's much easier and more reliable. In any case, have you `brew doctor`ed first? And are you running the `brew` you think you are (e.g., https://github.com/Homebrew/legacy-homebrew/issues/25647) – Dave Newton May 22 '18 at 15:26
  • Yeah, I'd use `rbenv` or `rvm` and curious why you are ruling those out. – Joe May 22 '18 at 17:36
  • I like to run terminal sessions inside of Emacs using `multiterm`. It's not so easy and straightforward to mirror environment variables needed by something like `rvm` inside of it, so I just avoid it: https://stackoverflow.com/questions/5521112/using-rvm-in-eshell-of-emacs . This is one of the reasons. The other one is that I was curious as to how to make this work / why it wasn't working. – Jonathan Soifer May 23 '18 at 06:56

1 Answers1

1

Check if both the ruby versions are installed. If both are installed, then try this:

brew unlink ruby@2.5 && brew link --force --overwrite ruby@2.3
suyogb
  • 146
  • 1
  • 2
  • 9