Homebrew: Can't install with options through brew (macOS Mojave) - macos

I need to install sphinx via homebrew with flags, but there is error
$ brew install sphinx --mysql --pgsql
Ignoring byebug-10.0.2 because its extensions are not built. Try: gem pristine byebug --version 10.0.2
Ignoring byebug-10.0.2 because its extensions are not built. Try: gem pristine byebug --version 10.0.2
Usage: brew install [options] formula
Install formula.
formula is usually the name of the formula to install, but it can be specified
in several different ways.
Unless HOMEBREW_NO_INSTALL_CLEANUP is set, brew cleanup will be run for the
installed formulae or, every 30 days, for all formulae.
--------------------------------------
Error: invalid option: --mysql
$ brew -v
Homebrew 2.1.6
Homebrew/homebrew-core (git revision bacd7; last commit 2019-06-25)
Homebrew/homebrew-cask (git revision 48e24; last commit 2019-06-25)

Try manticore (the sphinx fork). We added recently a tap, just brew tap manticoresoftware/tap && brew install manticoresearch. Formula compiles with support for all connectors (mysql,postgres,odbc).

--option support from hombrew-core formulae has been removed since Homebrew 2.0.0. Just the formulae repo homebrew-core, but not the brew command drops the support for --option, which means you can still define and use --option in your custom formula.
Release Note of Homebrew 2.0.0
Homebrew does not have any formulae with options in Homebrew/homebrew-core. Options will still be supported and encouraged by third-party taps. This change allows us to better focus on delivering binary packages rather than options. Formulae with options had to be built from source, could not be tested on our CI system and provided a disproportionate support burden on our volunteer maintainers.
If you wanna additional dependencies in a package, you have to modify the formula and build it by yourself.

Related

Unable to install Ruby on Mac with Homebrew

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.

Need help installing Ruby 2.7.2 on Mac

I'm trying to install Ruby version 2.7.2 on my Mac (latest OS with all updates) and did the following
brew update
brew upgrade rbenv ruby-build
and then
rbenv install 2.7.2
ruby-build: definition not found: 2.7.2
See all available versions with `rbenv install --list'.
If the version you need is missing, try upgrading ruby-build:
brew update && brew upgrade ruby-build
So I tried following the instructions above and get this
brew update && brew upgrade ruby-build
Already up-to-date.
Warning: ruby-build 20200926 already installed
You need to install the latest ruby-build
$ brew unlink ruby-build # remove STABLE version
$ brew install --HEAD ruby-build
$ rbenv install -l | grep '2.7.2'
2.7.2
Only latest stable releases for each Ruby implementation are shown.
Use 'rbenv install --list-all' to show all local versions.
The answer from #andrei-kovrov is correct but, alternatively, you can wait until this PR gets merged:
https://github.com/Homebrew/homebrew-core/pull/62096
Btw, this answer will not age well so, for reference, this is where the formulae are staged before they get released:
https://github.com/Homebrew/homebrew-core/pulls
It might be an issue reading the correct version of ruby based on the path that is specified. If you already have another version of ruby installed the path might not be updated to look for a newer version.
This article has a lot of really great information on how to set up ruby on a mac:
https://stackify.com/install-ruby-on-your-mac-everything-you-need-to-get-going/

rbenv not showing the available ruby versions

I have installed rbenv in my vagrant machine but when I try to list all the available ruby versions rbenv versions then it gives me this output:
system (set by /home/vagrant/.rbenv/version)
Does anyone know what is this?
Are you asking what the output of that command means? I'm looking at the rbenv documentation, and I think it indicates that rbenv only knows of one version of ruby - the version that came installed with your system.
Edit: If that's not the answer you were looking for, can you tell us what you expected to see? Did you have other versions installed on that machine?
Edit 2: If you want to see a list of versions you can install onto your machine, but aren't installed yet, run:
rbenv install --list
Here is more documentation for this command. This will help!
If you have tried both rbenv install --list and ruby-build --definitions and still can't see the latest Ruby versions on the list, then you need to upgrade ruby-build because that is what rbenv uses to "know" the available versions.
For example, assuming you use Mac OS X and installed ruby-build using Homebrew, you can update ruby-build by invoking:
brew upgrade ruby-build
Now, try listing the available versions again, and you should see the latest ones there.
Edit:
The ruby-build wiki lists a couple of ways of updating it, namely the above one using Homebrew and another one where it is installed as a plugin to rbenv:
cd "$(rbenv root)"/plugins/ruby-build && git pull
Rbenv is usually installed with it's companion ruby-build
You can get the versions available to be installed with:
ruby-build --definitions
To get a list of available ruby versions you can install, type the following:
rbenv install -l
To get a list of the ruby versions already installed on your machine, type the following:
rbenv versions
To answer your question as to what the below means:
system (set by /home/vagrant/.rbenv/version)
This is telling you that the system ruby (the default ruby installed on your system) is the only ruby version installed on your vagrant machine. Rbenv is using the default system ruby because it doesn't have any other ruby versions installed yet.
To see all available versions:
rbenv install --list-all
Or
rbenv install --list
To list only stable releases for each Ruby implementation.
If you are on Mac
brew upgrade rbenv ruby-build also works.
Documentation
List rbenv versions that are possible to install
"Only latest stable releases for each Ruby implementation are shown.
With the fewest key strokes (shorter than --list and --list-all)
rbenv install -l
Want to see what is available from rbenv to install?
ruby-build --definitions
Want to narrow that down a bit?
ruby-build --definitions | grep 3.0
To upgrade to the latest rbenv and update ruby-build with newly released Ruby versions, upgrade the Homebrew packages:
brew update && brew upgrade rbenv ruby-build
Also you can always just type rbenv
Which will give you a help menu
rbenv
TLDR the manpage or github repo or just plain forgot?
Take a peek at this site for quick rbenv recollection:
https://devhints.io/rbenv
Also, you may need to brew upgrade if you have installed with brew see here.

RVM pkg install checksum error

root#li417-132:~# rvm pkg install zlib
Fetching zlib-1.2.7.tar.gz to /usr/local/rvm/archives
There is no checksum for 'http://prdownloads.sourceforge.net/libpng/zlib-1.2.7.tar.gz' or 'zlib-1.2.7.tar.gz', it's not possible to validate it.
If you wish to continue with unverified download add '--verify-downloads 1' after the command.
Please note that it's required to reinstall all installed rubies:
rvm reinstall all --force
rvm all-gemsets do rvm gemset pristine
A weird problem happened today, other linux boxes i've setup a few days ago never did this, but today i cannot install any rvm packages, and adding '--verify-downloads 1' after the command seems to have no effect at all.
this is a new change in RVM, you can make it work with:
rvm --verify-downloads 1 pkg install zlib
The best solution would be adding md5 / sha512 for zlib so it could be validated
The command parsing was fixed already, udate rvm to make it working:
rvm get head
Deprecation warning:
rvm pkg is deprecated by autolibs:
rvm get stable
rvm autolibs enable
rvm install ruby
RVM will automatically use system package manager to install missing libraries and configure ruby with proper compilation settings if needed - on OSX RVM detects macports, homebrew, fink and if non found installs macports to handle the libraries installation.

Installing older version of imagemagick with homebrew

I need to install an older version of imagemagick (6.5.9-3), I can see it in the list of available versions
> brew versions
6.6.1-5 git checkout 1c9f04e Library/Formula/imagemagick.rb
6.5.9-8 git checkout 685dbff Library/Formula/imagemagick.rb
6.5.9-3 git checkout 258720c Library/Formula/imagemagick.rb
6.5.6-5 git checkout 7c90d02 Library/Formula/imagemagick.rb
6.5.5-10 git checkout b01c13d Library/Formula/imagemagick.rb
but when I checkout that version with
> git checkout 258720c Library/Formula/imagemagick.rb
and then run
> brew install imagemagick
I get an error saying that
Error: imagemagick is a head-only formula
Install with `brew install --HEAD imagemagick
Why is brew listing those versions if it can't install them?
So the question remains, how to install an older version of imagemagick with brew?
(This solution is not working any longer: Cannot install older version of ImageMagick via Homebrew)
Thanks in advance for your help.
You can define your own Homebrew formula in a GitHub Gist and install it with
brew install path/to/your/GistToYourPersonalImageMagickFormula
for example here or here
If it's for Ruby 1.8.6 compatibility, or any 6.5.9-x version will do, there is an ImageMagick 6.5.9.x formula provided as imagemagick-ruby186 in the homebrew-versions tap. This will be easiest, and will be supported by future updates.
brew tap homebrew/versions
brew install imagemagick-ruby186
Those 6.5.9.x versions of the original imagemagick formula are so old that they may have compatibility problems with the current brew ruby scripts. (They currently give "Formulae require at least a URL" errors; your error was probably a similar issue.) To get those to install, you'll probably have to roll back all of Homebrew to that point in time before doing the build, with a git checkout on the entire repo, not just the one file.
That other answer you linked will fail for the same reason - it's another mechanism of doing the same thing, just acquiring the old version of the imagemagick.rb formula via the web instead of through git, so it'll have the same compatibility problems.

Resources