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

Error: cannot load such file -- nokogiri on livecheck run #11486

Closed
2 tasks done
SMillerDev opened this issue Jun 3, 2021 · 17 comments · Fixed by #11599
Closed
2 tasks done

Error: cannot load such file -- nokogiri on livecheck run #11486

SMillerDev opened this issue Jun 3, 2021 · 17 comments · Fixed by #11599
Labels
bug Reproducible Homebrew/brew bug outdated PR was locked due to age

Comments

@SMillerDev
Copy link
Member

brew config output

HOMEBREW_VERSION: 3.1.9-116-gd2ddb80
ORIGIN: https://github.com/Homebrew/brew.git
HEAD: d2ddb80cf4c3b518e776a926bea5c1f02be67369
Last commit: 26 minutes ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: eaa9ef741c7ad0e66cbf0764182571c637d28fba
Core tap last commit: 3 hours ago
Core tap branch: master
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_DEVELOPER: set
HOMEBREW_EDITOR: nano
HOMEBREW_GITHUB_API_TOKEN: set
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: octa-core 64-bit kabylake
Clang: 12.0.5 build 1205
Git: 2.31.1 => /usr/local/bin/git
Curl: 7.64.1 => /usr/bin/curl
macOS: 11.5-x86_64
CLT: 12.5.0.0.1.1617976050
Xcode: 12.5

brew doctor output

Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build-trouble and cause formulae that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
  php

Warning: You have uncommitted modifications to Homebrew/homebrew-core.
If this is a surprise to you, then you should stash these modifications.
Stashing returns Homebrew to a pristine state but can be undone
should you later need to do so for some reason.
  cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core && git stash && git clean -d -f

Uncommitted files:
  ?? Formula/graal.rb

  • I ran brew update and am still able to reproduce my issue.
  • I have resolved all warnings from brew doctor and that did not fix my problem.

What were you trying to do (and why)?

run brew livecheck --installed --newer-only to update software in brew.

What happened (include all command output)?

[sean] ~> brew livecheck --installed --newer-only
contentful-cli : 1.6.40 ==> 1.6.41
Error: cannot load such file -- nokogiri
Please report this issue:
  https://docs.brew.sh/Troubleshooting
/usr/local/Homebrew/Library/Homebrew/livecheck/strategy/sparkle.rb:61:in `require'
/usr/local/Homebrew/Library/Homebrew/livecheck/strategy/sparkle.rb:61:in `item_from_content'
/usr/local/Homebrew/Library/Homebrew/livecheck/strategy/sparkle.rb:119:in `find_versions'
/usr/local/Homebrew/Library/Homebrew/livecheck/livecheck.rb:532:in `block in latest_version'
/usr/local/Homebrew/Library/Homebrew/livecheck/livecheck.rb:479:in `each'
/usr/local/Homebrew/Library/Homebrew/livecheck/livecheck.rb:479:in `each_with_index'
/usr/local/Homebrew/Library/Homebrew/livecheck/livecheck.rb:479:in `latest_version'
/usr/local/Homebrew/Library/Homebrew/livecheck/livecheck.rb:189:in `block in run_checks'
/usr/local/Homebrew/Library/Homebrew/livecheck/livecheck.rb:142:in `map'
/usr/local/Homebrew/Library/Homebrew/livecheck/livecheck.rb:142:in `with_index'
/usr/local/Homebrew/Library/Homebrew/livecheck/livecheck.rb:142:in `run_checks'
/usr/local/Homebrew/Library/Homebrew/dev-cmd/livecheck.rb:115:in `livecheck'
/usr/local/Homebrew/Library/Homebrew/brew.rb:122:in `<main>'

What did you expect to happen?

return outdated software

Step-by-step reproduction instructions (by running brew commands)

`brew livecheck --installed --newer-only`
@SMillerDev SMillerDev added the bug Reproducible Homebrew/brew bug label Jun 3, 2021
@nandahkrishna
Copy link
Member

nandahkrishna commented Jun 3, 2021

I just merged a Dependabot PR to upgrade nokogiri, but livecheck does run install_bundler_gems, so I'm unsure why this is still happening. To confirm, I ran livecheck on a list of Sparkle-strategy casks, but the gems were installed first so I didn't see this error.

@SMillerDev
Copy link
Member Author

I had this in an upgrade run before, so I don't think it's really missing:

Fetching rubocop 1.16.0
Installing mini_portile2 2.5.3
Fetching nokogiri 1.11.7
Installing rubocop 1.16.0
Installing nokogiri 1.11.7 with native extensions

@zachauten
Copy link
Contributor

@SMillerDev Is nokogiri in Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/? I was able to run livecheck fine, but I reproduced the issue by manually deleting nokogiri at that path.

@SMillerDev
Copy link
Member Author

ls Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/nokogiri-1.11.7/ works fine and there are files there.

@gibfahn
Copy link
Contributor

gibfahn commented Jun 4, 2021

Does this work around the issue? It did for me.

HOMEBREW_FORCE_VENDOR_RUBY=1 brew livecheck --installed --newer-only

I hit this too, seems only to happen for sparkle livecheck blocks that need to parse xml.

@SMillerDev
Copy link
Member Author

Forcing a vendor ruby did not help, but brew livecheck --installed --newer-only --formula works supporting the idea that it's sparkle related.

@Bo98
Copy link
Member

Bo98 commented Jun 10, 2021

Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/nokogiri-1.11.7/

It should be:

Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/nokogiri-1.11.7-x86_64-darwin/

(yes, we know this doesn't work on arm64 - that is a RubyGems issue)

@SMillerDev
Copy link
Member Author

Any reason my macOS could have installed a nokogiri without a platform?

@Bo98
Copy link
Member

Bo98 commented Jun 10, 2021

Not sure. The one you have should be the default if it can't find a matching platform (but our load path stuff won't pick this up atm - it only handles x86_64-darwin).

You could try rm that directory plus Library/Homebrew/vendor/bundle/ruby/2.6.0/specifications/nokogiri-1.11.7.gemspec and see if it happens again.

@SMillerDev
Copy link
Member Author

You could try rm that directory plus Library/Homebrew/vendor/bundle/ruby/2.6.0/specifications/nokogiri-1.11.7.gemspec and see if it happens again.

It does, nokogiri gets installed again without a platform specification.

@Bo98
Copy link
Member

Bo98 commented Jun 10, 2021

What does brew ruby -e "puts Gem.platforms" output?

@SMillerDev
Copy link
Member Author

[sean] /u/l/Homebrew (master)> brew ruby -e "puts Gem.platforms"
ruby
x86_64-darwin-14

@Bo98
Copy link
Member

Bo98 commented Jun 10, 2021

Should be fine. (Though weirdly, Darwin 14 is the Portable Ruby platform but your brew config indicates system Ruby is used.)

@SMillerDev
Copy link
Member Author

Likely because I ran #11486 (comment) since making the issue.

@MikeMcQuaid
Copy link
Member

At this point I think the appropriate solution is to remove the use of nokogiri in favour of rexml (which doesn't require a native gem).

@samford
Copy link
Member

samford commented Jun 22, 2021

At this point I think the appropriate solution is to remove the use of nokogiri in favour of rexml (which doesn't require a native gem).

I've been working on fixing/improving parts of the Sparkle strategy in relation to an open PR, so I'll look into switching to rexml while I'm at it.

I've been planning to add a generic Xml strategy at some point and have Sparkle use parts of it internally, so it may make sense to do this together.

Edit: I now have this implemented locally and I'm working on putting the finishing touches on it before creating a PR.

@MikeMcQuaid
Copy link
Member

😍 sounds great @samford!

@github-actions github-actions bot added the outdated PR was locked due to age label Jul 29, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Reproducible Homebrew/brew bug outdated PR was locked due to age
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants