Linuxbrew / brew

:beer::penguin: The Homebrew package manager for Linux
https://linuxbrew.sh
BSD 2-Clause "Simplified" License
2.65k stars 235 forks source link

Installation on Alpine linux #839

Closed antunderwood closed 6 years ago

antunderwood commented 6 years ago

When trying to install brew on Alpine Linux, following these instructions I run into the following problem


==> Tapping homebrew/core
Cloning into '/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core'...
remote: Counting objects: 4884, done.
remote: Compressing objects: 100% (4682/4682), done.
remote: Total 4884 (delta 48), reused 342 (delta 11), pack-reused 0
Receiving objects: 100% (4884/4884), 4.30 MiB | 1.49 MiB/s, done.
Resolving deltas: 100% (48/48), done.
Error: Invalid formula: /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/jnethack.rb
jnethack: cannot load such file -- etc
Error: Invalid formula: /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/slashem.rb
slashem: cannot load such file -- etc
Error: Invalid formula: /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/nethacked.rb
nethacked: cannot load such file -- etc
Error: Cannot tap homebrew/core: invalid syntax in tap!
Error: Failure while executing; `/home/linuxbrew/.linuxbrew/bin/brew tap homebrew/core` exited with 1.```
sjackman commented 6 years ago

It looks like the ruby provided by Alpine Linux is missing a piece (the etc package), causing Brew to fail. If you don't install the ruby packages using apk, Brew will use its own Ruby, which should work fine. I've updated the Wiki. brew vendor-install ruby should hopefully also resolve the issue.

sjackman commented 6 years ago

I'm closing this issue, but feel free to comment. I'd be curious to hear if the suggested changes work for you.

antunderwood commented 6 years ago

Unfortunately the vendor install of ruby did not work, complaining of missing irb libraries

Following the steps in this gist worked (Thanks to your pointer about the ruby-etc lib). I also needed to add the gzip package

https://gist.github.com/aunderwo/afc81f8fb7dbcec64b01cc807b491765

jonchang commented 6 years ago

@aunderwo nice work! Would you be interested in adding the dependencies to install to the README?

iMichka commented 6 years ago

Maybe even better: update the wiki: https://github.com/Linuxbrew/brew/wiki/Alpine-Linux

The Readme is quite general, and alpine Linux is an edge case.

sjackman commented 6 years ago

What was the error that the brewed portable-ruby gave? It is expected to work. It's a bug if it doesn't.

sjackman commented 6 years ago

Glad to hear that you got it working in any case.