Linuxbrew-core: Hub formula fails to install on Linux due to bundler issues

Created on 21 Jan 2019  ·  13Comments  ·  Source: Homebrew/linuxbrew-core

(Moved from https://github.com/Homebrew/homebrew-core/issues/36223)

  • [x] are reporting a bug others will be able to reproduce and not asking a question or requesting software. If you're not sure or want to ask a question do so on our Discourse: https://discourse.brew.sh. To get software added or changed in Homebrew please file a Pull Request
  • [x] have a problem with brew install (or upgrade, reinstall) a single, official formula (not cask)? If it's a general brew problem please file this issue at Homebrew/brew: https://github.com/Homebrew/brew/issues/new/choose. If it's a brew cask problem please file this issue at https://github.com/Homebrew/homebrew-cask/issues/new/choose. If it's a tap (e.g. Homebrew/homebrew-php) problem please file this issue at the tap.
  • [x] ran brew update and can still reproduce the problem?
  • [x] ran brew doctor, fixed all issues and can still reproduce the problem?
  • [x] ran brew gist-logs <formula> (where <formula> is the name of the formula that failed) and included the output link?
  • [ ] if brew gist-logs didn't work: ran brew config and brew doctor and included their output with your issue?

hub won't install under Linuxbrew due to a mismatch in bundler versions.
https://gist.github.com/liamdawson/257f4659a4e7493f5af16ff90a40cd7c

Reproduce by creating an Ubuntu/etc. virtual machine, and running brew install hub.

The process of installing the hub formula installs Ruby 2.6, which includes bundler as a default gem, so I suspect it's an issue borne of trying to use a different gem version in that environment.

outdated

All 13 comments

I got the same OS (Ubuntu 18.10). But didn't have troubles with hub installation. See my gists maybe it helps you…

$ brew config
Homebrew Ruby: 2.3.7 => /opt/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/bin/ruby

Using system ruby2.6.0 from Brightbox's -t bionic PPA as rbenv shell's version OR ruby/2.6.0_1 from cellar as rbenv shell's version.
And when I rehashed environment and made

$ brew config
Homebrew Ruby: 2.6.0  (which pointed to brew's installed ruby 2.6.0_1)

I also could remove/install hub normally.
PS rbenv is a RVM analog

Yeah, weird, I just tried again and it built this time. Only thing I changed was logging into a Ubuntu instead of a Gnome session, and I doubt it's related. Maybe something changed in brew/the formula since my last attempt? Either way, I'll try to repro in a VM again, and if it doesn't happen, easy to close.

Okay, I successfully reproduced it in the virtual machine, here are more specific instructions:

  • Create a virtual machine with default Virtualbox configuration for Ubuntu 18.10
  • Attached Ubuntu 18.10 desktop media
  • Ubuntu install with the following settings:

    • English (Australia) keyboard layout

    • Minimal install

    • Proprietary components included

    • LVM configuration

  • After install, apt update and apt upgrade
  • Install Linuxbrew
  • apt install build-essential
  • brew install hub

If there are still repro issues, I can upload the VM, but that will take quite a while.

Ok. I will renew and run Dockerfile, that actually using ubuntu/xenial ubuntu/cosmic contaner to test hub


PS https://github.com/Homebrew/brew/issues/5561 is also bundle related with two possible ways to coupe with problems:
export HOMEBREW_FORCE_VENDOR_RUBY=1
or

export HOMEBREW_DEVELOPER=true; export HOMEBREW_RUBY_PATH=/home/linuxbrew/.linuxbrew/Cellar/ruby/2.6.0_1/bin/ruby

Freaking strange:
eerror.txt
My ubuntu/cosmic Dockerfile:
Dockerfile.txt

Run it with docker build command (100% :bangbang: reproducibility)

I see also there errors in your file:

/bin/sh: 1: groff: not found
/bin/sh: 1: col: not found

These dependencies need to be added to the hub formula. We should try that out to see if it helps.

They actually present

if !OS.mac? && build.with?("docs")
    depends_on "bsdmainutils" => :build
    depends_on "groff" => :build
    depends_on "ruby" => :build
…

I don't know what to do with formula and with installed groff and colbsdmainutils. Nothing helped.
Variants I tried (see updated Dockerfile.txt):

  • like in example above
  • same, but without hashrocket => :build for groff and bsdmainutil
  • tried to brew install groff and bsdmainutil before hub installation

groff -Wall -mtty-char -mandoc -Tutf8 -rLL=87n share/man/man1/hub.1.ronn | col -b >share/man/man1/hub.1.txt ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-linux] /tmp/hub-20190121-7163-6g8o7/hub-2.7.0/gem_home/bin/bundle:23:in `load': cannot load such file -- /home/linuxbrew/.linuxbrew/lib/ruby/gems/2.6.0/gems/bundler-1.17.2/exe/bundle (LoadError) from /tmp/hub-20190121-7163-6g8o7/hub-2.7.0/gem_home/bin/bundle:23:in `<main>' /tmp/hub-20190121-7163-6g8o7/hub-2.7.0/gem_home/bin/bundle:23:in `load': cannot load such file -- /home/linuxbrew/.linuxbrew/lib/ruby/gems/2.6.0/gems/bundler-1.17.2/exe/bundle (LoadError) from /tmp/hub-20190121-7163-6g8o7/hub-2.7.0/gem_home/bin/bundle:23:in `<main>' You need Ruby 1.9 or higher and Bundler to run hub tests make: *** [Makefile:51: bin/ronn] Error 1
https://gist.github.com/liamdawson/257f4659a4e7493f5af16ff90a40cd7c#file-02-make-L8-L15

I made some changes and built a bottle: #11450

I could not reproduce the bundler issues. But there were some hub updates lately, they maybe fixed it?

@iMichka, yes my ubuntu cosmic dockerfile used bottle:
🍺 /home/linuxbrew/.linuxbrew/Cellar/hub/2.8.4: 36 files, 8.1MB
No patches need to be applied

Glad to hear that it's working!

yup -working for me too on hub 2.8.4 :-)

Was this page helpful?
0 / 5 - 0 ratings