I have a formula that depends on a gem. It has depends_on 'some-gem' => :ruby at the top. I am sure it is installed, since I can use it as intended and it’s there when running gem list. However, when trying to install the formula, it shows
my-formula: Unsatisfied dependency: some-gem
Homebrew does not provide Ruby dependencies; install with:
gem install some-gem
Error: An unsatisfied requirement failed this build.
So, how does Homebrew check for installed gems?
The actual check that is run to detect installed gems and similar things is in /usr/local/Library/Homebrew/requirements/language_module_dependency.rb, which in the case of Ruby does:
/usr/bin/env ruby -rubygems -e require\ 'GEMNAME'
Note that this calls ruby from the path, so it could be affected by mixups there. Make sure you have the right ruby first in your path, have the right gem program that goes with ruby, and possibly add some debugging to your formula to see what environment it is running under.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With