Unable to install Ruby on Mac with Homebrew - ruby

I am trying to install ruby 3.0 with Homebrew.
brew install ruby
But I am getting an error
Error: No available formula or cask with the name "ruby".
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching taps on GitHub...
Error: No formulae found in taps.
When I try 'brew search ruby', I get this:
==> Formulae
homebrew/portable-ruby/portable-libyaml
homebrew/portable-ruby/portable-ncurses
homebrew/portable-ruby/portable-openssl
homebrew/portable-ruby/portable-readline
homebrew/portable-ruby/portable-ruby
homebrew/portable-ruby/portable-zlib
==> Casks
rubymine rubymotion
I tried uninstalling homebrew and reinstalling it and also used brew cleanup. Nothing worked.
Also, my MacOS version is 11.2.3 (20D91) MacOS Big Sur.

I was getting the same error and ran brew doctor which gave me this message:
Warning: Homebrew/homebrew-core was not tapped properly! Run:
rm -rf "/opt/homebrew/Library/Taps/homebrew/homebrew-core"
brew tap homebrew/core
Try running brew doctor and see if you get the same.
I followed the instructions and yah! I have ruby!

This isn't an exact answer for your question, but an alternate approach, and one I recommend following when using languages like Ruby and Python, where you often need multiple different versions installed simultaneously, along with the ability to switch between them as you move between projects: use a tool like RVM.
If brew cannot find/install the version you need, rvm will download and build it from source, and then you can switch between versions with rvm use <version>. When I was doing a lot of ruby dev some years back I found it indispensable, and it's going to be a faster way to stay current than waiting on homebrew to keep pace, generally.
(edit) Other functionally similar tools include rbenv and chruby.

Related

Can't install TBB using Homebrew on MacOS

I have been trying to install TBB using Homebrew on my MacOS Ventura Hackintosh (AMD) and I have been unable to even install anything using Homebrew. Here's the output of running brew install tbb sam#adsl ~ % brew install tbb Warning: No available formula with the name "tbb". ==> Searching for similarly named formulae... Error: No similarly named formulae found. ==> Searching for a previously deleted formula (in the last month)... Error: No previously deleted formula found. ==> Searching taps on GitHub... Error: No formulae found in taps.
Any tips? Thanks!
Your brew installation seems corrupt.
Run these commands to resolve and fix issue:
% brew update
% brew upgrade
% brew doctor
Doctor can report a number of warnings:
Warning: You have unlinked kegs in your Cellar.
You may wish to link these or uninstall these.
Warning: /usr/bin occurs before /opt/homebrew/bin in your PATH.
You may wish to modify your PATH to put homebrew first.

How to configure rbenv with ruby?

I've tried to install ruby on my mac. Ruby is already installed :
brew install ruby
Running `brew update --preinstall`...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core and homebrew/cask).
==> New Formulae
ghcup reshape tidy-viewer vermin
==> Updated Formulae
Updated 159 formulae.
==> New Casks
kindavim music-bar presentation
==> Updated Casks
Updated 143 casks.
==> Deleted Casks
airqmon
Warning: ruby 3.0.3 is already installed and up-to-date.
To reinstall 3.0.3, run:
brew reinstall ruby
But when i run ruby -version, i get the following result :
/Users/oscar/.rbenv/shims/ruby: line 21: /usr/local/Cellar/rbenv/0.4.0/libexec/rbenv: No such file or directory
I am using rbenv. I've tried to reinstall rbenv but i get the same error.
I am new in ruby and i need some help please.
How to solve this error ?
Thanks
You installed Ruby previously with rbenv and now you show that you installed Ruby with brew, which is a totally different process. I assume you removed your rbenv installation, but left around some leftovers. If you wish to continue with your brew Ruby installation, which is in my opinion perfectly good, you just need to remove the rbenv leftovers by removing your /Users/oscar/.rbenv directory, possibly you may also need to restart your Terminal.

Brew Install Trouble

I'm struggling to brew install minikube. I don't have any version, but need an older version. I'm trying the familiar way, but get an error:
~ brew install minikube#1.18.1
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
Error: No available formula or cask with the name "minikube#1.18.1".
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching taps on GitHub...
Error: No formulae found in taps.
I've tried to do a bit of homework, but still errors:
~ brew install https://github.com/Homebrew/homebrew-core/blob/8d37c361ee69503961a3010e7896f6ecf8d3a059/Formula/minikube.rb
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
Updated 16 formulae.
Traceback (most recent call last):
`brew extract` or `brew create` and `brew tap-new` to create a formula file in a tap on GitHub instead.: Invalid usage: Non-checksummed download of minikube formula file from an arbitrary URL is unsupported! (UsageError)
`brew extract` or `brew create` and `brew tap-new` to create a formula file in a tap on GitHub instead.: Invalid usage: Non-checksummed download of minikube formula file from an arbitrary URL is unsupported! (UsageError)
This must be elementary, but I can't seem to figure this out :(
$brew update-reset
This helped me with the error.
Brew only does creates separate versions for certain formula, and its mostly only the larger ones where they might provide different versions due to backward compatibility and stuff.
You might have some luck with the answers in this question Homebrew install specific version of formula?.
Before running:
brew install https://github.com/Homebrew/homebrew-core/blob/8d37c361ee69503961a3010e7896f6ecf8d3a059/Formula/minikube.rb
you should execute:
brew unlink minikube
That way you will remove the old minikube links and link the newly installed binary.
If that's still not working than try running:
wget https://github.com/Homebrew/homebrew-core/blob/8d37c361ee69503961a3010e7896f6ecf8d3a059/Formula/minikube.rb
followed by:
brew install --HEAD -s minikube.rb
I think first you can try to run 'brew install minikube' only, see if you can successfully install it or not. If no error then it's probably your version issue. If still has Error then that might be your local home-brew issues, then you can Try to run 'brew doctor', based on the warning and Error info search in stackoverflow you probably will find out the answer.

How do I install the latest developer package for wine with homebrew? (wine-3.0-rc2)

When I type in:
brew install wine
That should install Wine 2.0.3, right? (the latest release)
But I want to install a specific version of wine: wine 3.0 rc2
What would the command to do this be if I'm using homebrew? I've tried
brew install wine-devel
But it gives me this error:
Error: No available formula with the name "wine-devel"
Any help? Thanks!
Currently wine-devel has been moved to caskroom/versions. Therefore in order to install wine-devel you have to
Tap caskroom/versions, by running brew tap caskroom/versions
Update homebrew (...just to be sure) by running brew update
Finally install wine-devel by running brew install caskroom/versions/wine-devel
caskroom/versions was moved to homebrew/cask-versions.
The following will work:
brew tap homebrew/cask-versions
brew install homebrew/cask-versions/wine-devel
You will be asked for your password.
Then you should be able to start executables as follows:
wine /path/to/app.exe
I was trying to install wine-devel, but ran into a similar problem. It seems that the answers here may each have been relevant on a different year, as the casks have moved around back and forth. So here's the latest on the situation, and some info on how to handle it in future.
The official instructions (as of 4th April 2020) say to run brew cask install wine-stable. However, that leads to an error:
$ brew cask install wine-stable
Error: Cask wine-staging exists in multiple taps:
homebrew/cask-versions/wine-staging
caskroom/versions/wine-staging
This means that two potential casks were found, each with the same name, yet each on a different repository, and Homebrew was unsure which one to install.
Running this command gave me a clue about what was going on:
$ brew tap caskroom/versions
Error: caskroom/versions was moved. Tap homebrew/cask-versions instead.
So I learned that you can untap third-party repositories, and untapped the one that the message seemed to advise not to tap WINE casks from.
$ brew untap caskroom/versions
Untapping caskroom/versions...
Untapped 156 casks (463 files, 56.7MB).
$ brew cask install wine-stable
... Success!
To install the development version just pass --devel
brew install --devel wine

Ruby on Rails install trouble on OSX with dependencies

I'm trying to install RoR on Mountain Lion. I have the following installed:
Xcode from the App Store with command line tools
RVM
homebrew
In terminal I verified that gcc is installed.
When I type in "rvm requirements" I get a message saying that I'm missing a number of dependencies including OpenSSL, autoconf, automake, libxslt and many more. RVM also says to install these with brew. So I do and rvm no longer complains about the missing dependencies.
But when I try to install ruby 1.9.3 via "rvm install 1.9.3", at the end of the compile I receive a message "ruby was built using clang -but it's not (fully) supported, expect errors."
I'm stumped at this point. I'm trying to figure out:
Why are dependencies missing when I've installed Xcode command line tools?
Why am I still getting a compile error after using brew to install the dependencies?
Help please. :)
Try using gcc compiler instead i.e
rvm install 1.9.3 --with-gcc-4.2
Reference: https://github.com/wayneeseguin/rvm/issues/1480
So here's the order I usually go through before installing any Rubies.
1st thing: Install XCode and the Command Line Tools for Mountain Lion (you can also install these from the Preferences > Downloads window).
2nd: Make sure you have Homebrew installed.
3rd: Once that's set up, run brew tap homebrew/dupes
4th: Then brew install openssl autoconf apple-gcc42 automake
I had issues with RVM and have long since switched to RBenv/Ruby-Build. There are various differences, but really running through the above steps should fix any issues you had, and lots of people use one or the other. Both are great.
Then, just try to install Ruby however you choose to.

Resources