Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

brew audit & tests: unable to resolve dependency #35647

Closed
JarryShaw opened this issue Jan 3, 2019 · 6 comments
Closed

brew audit & tests: unable to resolve dependency #35647

JarryShaw opened this issue Jan 3, 2019 · 6 comments
Labels
outdated PR was locked due to age ruby Ruby use is a significant feature of the PR or issue

Comments

@JarryShaw
Copy link
Contributor

When running brew audit and brew tests, the following messages are given:

$ brew audit
==> Installing or updating 'rubocop' gem
Error: Unable to resolve dependency: user requested 'did_you_mean (= 1.0.0)'
$ brew tests
==> Installing or updating 'bundler' gem
Error: Unable to resolve dependency: user requested 'did_you_mean (= 1.0.0)'

And brew doctor says there's no problem:

$ brew doctor
Your system is ready to brew.

Information for Ruby and RubyGems is as follows:

$ which ruby
/usr/local/opt/ruby/bin/ruby
$ ruby --version
ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-darwin18]
$ which gem
/usr/local/opt/ruby/bin/gem
$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 3.0.2
  - RUBY VERSION: 2.6.0 (2018-12-25 patchlevel 0) [x86_64-darwin18]
  - INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/2.6.0
  - USER INSTALLATION DIRECTORY: /Users/jarryshaw/.gem/ruby/2.6.0
  - RUBY EXECUTABLE: /usr/local/opt/ruby/bin/ruby
  - GIT EXECUTABLE: /usr/local/bin/git
  - EXECUTABLE DIRECTORY: /usr/local/lib/ruby/gems/2.6.0/bin
  - SPEC CACHE DIRECTORY: /Users/jarryshaw/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /usr/local/Cellar/ruby/2.6.0/etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-18
  - GEM PATHS:
     - /usr/local/lib/ruby/gems/2.6.0
     - /Users/jarryshaw/.gem/ruby/2.6.0
     - /usr/local/Cellar/ruby/2.6.0/lib/ruby/gems/2.6.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /usr/local/sbin
     - /usr/local/opt/ruby/bin
     - /usr/local/bin
     - /usr/bin
     - /bin
     - /usr/sbin
     - /sbin
     - /Applications/VMware Fusion.app/Contents/Public
     - /usr/local/MacGPG2/bin
     - /opt/X11/bin
     - /Applications/Wireshark.app/Contents/MacOS
     - /usr/local/opt/python/bin
     - /usr/local/opt/python@2/bin
     - /usr/local/opt/pypy3/bin
     - /usr/local/opt/pypy/bin
     - /Users/jarryshaw/go/bin
     - /usr/local/opt/python/bin
     - /usr/local/opt/python@2/bin
     - /usr/local/opt/pypy3/bin
     - /usr/local/opt/pypy/bin
     - /Users/jarryshaw/go/bin
$ gem list

*** LOCAL GEMS ***

activesupport (5.2.2)
addressable (2.5.2)
bundler (default: 1.17.3)
concurrent-ruby (1.1.4)
did_you_mean (1.3.0)
faraday (0.15.4)
faraday-http-cache (2.0.0)
github_changelog_generator (1.14.3)
i18n (1.4.0)
minitest (5.11.3)
multi_json (1.13.1)
multipart-post (2.0.0)
net-telnet (0.2.0)
octokit (4.13.0)
power_assert (1.1.3)
public_suffix (3.0.3)
rainbow (3.0.0)
rake (12.3.2)
retriable (3.1.2, 2.1.0)
rubygems-update (3.0.2)
sawyer (0.8.1)
test-unit (3.2.9)
thread_safe (0.3.6)
tzinfo (2.0.0, 1.2.5)
xmlrpc (0.3.0)
$ /usr/bin/ruby --version
ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin18]
$ /usr/bin/gem list

*** LOCAL GEMS ***

bigdecimal (1.3.5, default: 1.2.8)
CFPropertyList (2.2.8)
did_you_mean (1.0.0)
io-console (0.4.6, default: 0.4.5)
json (2.1.0, default: 1.8.3.1)
libxml-ruby (3.1.0, 2.9.0)
mini_portile2 (2.3.0)
minitest (5.11.3, 5.8.5)
net-telnet (0.2.0, 0.1.1)
nokogiri (1.5.6)
power_assert (1.1.3, 0.2.6)
psych (3.0.2, default: 2.1.0.1)
rake (10.4.2)
rdoc (default: 4.2.1)
sqlite3 (1.3.13, 1.3.11)
test-unit (3.2.8, 3.1.5)
$ /usr/bin/gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 2.7.6
  - RUBY VERSION: 2.3.7 (2018-03-28 patchlevel 456) [universal.x86_64-darwin18]
  - INSTALLATION DIRECTORY: /Library/Ruby/Gems/2.3.0
  - USER INSTALLATION DIRECTORY: /Users/jarryshaw/.gem/ruby/2.3.0
  - RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/bin
  - SPEC CACHE DIRECTORY: /Users/jarryshaw/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /Library/Ruby/Site
  - RUBYGEMS PLATFORMS:
    - ruby
    - universal-darwin-18
  - GEM PATHS:
     - /Library/Ruby/Gems/2.3.0
     - /Users/jarryshaw/.gem/ruby/2.3.0
     - /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/gems/2.3.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /usr/local/sbin
     - /usr/local/opt/ruby/bin
     - /usr/local/bin
     - /usr/bin
     - /bin
     - /usr/sbin
     - /sbin
     - /Applications/VMware Fusion.app/Contents/Public
     - /usr/local/MacGPG2/bin
     - /opt/X11/bin
     - /Applications/Wireshark.app/Contents/MacOS
     - /usr/local/opt/python/bin
     - /usr/local/opt/python@2/bin
     - /usr/local/opt/pypy3/bin
     - /usr/local/opt/pypy/bin
     - /Users/jarryshaw/go/bin
     - /usr/local/lib/ruby/gems/2.5.0/bin
     - /usr/local/opt/python/bin
     - /usr/local/opt/python@2/bin
     - /usr/local/opt/pypy3/bin
     - /usr/local/opt/pypy/bin
     - /Users/jarryshaw/go/bin

FYI, my system is "macOS Mojave Version 10.14.3 Beta (18D32a)", though this issue has occurred ever since macOS High Sierra (before that I was not using Homebrew).

ps: I've tried to reinstall Homebrew once when Mojave first released, but the problem remains.

@SMillerDev SMillerDev added the ruby Ruby use is a significant feature of the PR or issue label Jan 3, 2019
@igas
Copy link
Contributor

igas commented Jan 5, 2019

I periodically hit the same Mojave bug. On homebrew forum I found a solution:

brew vendor-install ruby

Does it solve your issue?

@JarryShaw
Copy link
Contributor Author

Oh my! @igas you save my life!

brew audit works fine now. brew tests still has some problems though... (seems its a Ruby issue, but I have no idea about Ruby environment, and StackOverflow didn't save me 🙃)

$ brew tests
Fetching gem metadata from https://rubygems.org/........
Using ast 2.4.0
Using bundler 1.17.3
Fetching json 2.1.0
Installing json 2.1.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/json-2.1.0/ext/json/ext/parser
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/bin/ruby -r
./siteconf20190105-29729-1rtv9fg.rb extconf.rb
checking for rb_enc_raise() in ruby.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
	--with-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/bin/$(RUBY_BASE_NAME)
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/mkmf.rb:456:in `try_do':
The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/mkmf.rb:535:in
`block in try_link0'
from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/tmpdir.rb:89:in
`mktmpdir'
from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/mkmf.rb:532:in
`try_link0'
from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/mkmf.rb:556:in
`try_link'
from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/mkmf.rb:765:in
`try_func'
from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/mkmf.rb:1051:in
`block in have_func'
from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/mkmf.rb:942:in
`block in checking_for'
from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/mkmf.rb:350:in
`block (2 levels) in postpone'
from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/mkmf.rb:320:in
`open'
from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/mkmf.rb:350:in
`block in postpone'
from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/mkmf.rb:320:in
`open'
from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/mkmf.rb:346:in
`postpone'
from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/mkmf.rb:941:in
`checking_for'
from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/mkmf.rb:1050:in
`have_func'
	from extconf.rb:4:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/extensions/universal-darwin-9/2.3.0-static/json-2.1.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/json-2.1.0 for inspection.
Results logged to
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/extensions/universal-darwin-9/2.3.0-static/json-2.1.0/gem_make.out

An error occurred while installing json (2.1.0), and Bundler cannot continue.
Make sure that `gem install json -v '2.1.0' --source 'https://rubygems.org/'` succeeds before
bundling.

In Gemfile:
  coveralls was resolved to 0.8.22, which depends on
    simplecov was resolved to 0.16.1, which depends on
      json
Randomized with seed 35658
bundler: command not found: parallel_rspec
Install missing gem executables with `bundle install`

@igas
Copy link
Contributor

igas commented Jan 6, 2019

Interesting. There is also brew vendor-gems but it does not include what you are trying to do. Why do you trying to run brew tests? I saw you contributed formula, to test formula you should use brew test formula_name.

@JarryShaw
Copy link
Contributor Author

well… I know that its not mandatory for formula authors, but its somehow annoying knowing that some stuff cannot work well on my Mac 🤦‍♂️

@clippit
Copy link
Contributor

clippit commented Jan 14, 2019

I have the same problem. System ruby doesn't work with "fatal error: 'ruby/config.h' file not found" error and vendor ruby failed with "checking for rb_enc_raise() in ruby.h... *** extconf.rb failed ***".
I don't know if there is any relation with "ld: warning: The i386 architecture is deprecated for macOS (remove from the Xcode build setting: ARCHS)"??

mkmf.log: https://gist.github.com/clippit/0de119f1ff1965e87c1569da2d4fd178

@MikeMcQuaid
Copy link
Member

This is being tracked in Homebrew/brew#5561

@lock lock bot added the outdated PR was locked due to age label Feb 20, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Feb 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age ruby Ruby use is a significant feature of the PR or issue
Projects
None yet
Development

No branches or pull requests

5 participants