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

Not a Passenger problem (was: 'gem install passenger' fails on Alpine Linux 3.8) #2124

Open
netmute opened this issue Oct 3, 2018 · 7 comments

Comments

@netmute
Copy link

netmute commented Oct 3, 2018

Issue report

Are you sure this is a bug in Passenger?
No

Please try with the newest version of Passenger to avoid issues that have already been fixed
Clean/Fresh Alpine Linux 3.8 VM
Passenger version is 5.3.5, Ruby version is 2.5.1

Question 1: What is the problem?

  • What is the expected behavior?
    Passenger installs.
  • What is the actual behavior?
    gem install passenger fails with:
Building native extensions. This could take a while...
ERROR:  Error installing passenger:
	ERROR: Failed to build gem native extension.

    current directory: /usr/lib/ruby/gems/2.5.0/gems/passenger-5.3.5/src/helper-scripts/download_binaries
/usr/bin/ruby -r ./siteconf20181003-2081-pcqjoq.rb extconf.rb
/usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': cannot load such file -- etc (LoadError)
	from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
	from /usr/lib/ruby/gems/2.5.0/gems/passenger-5.3.5/src/ruby_supportlib/phusion_passenger.rb:268:in `infer_install_spec'
	from /usr/lib/ruby/gems/2.5.0/gems/passenger-5.3.5/src/ruby_supportlib/phusion_passenger.rb:102:in `locate_directories'
	from extconf.rb:46:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /usr/lib/ruby/gems/2.5.0/gems/passenger-5.3.5 for inspection.
Results logged to /usr/lib/ruby/gems/2.5.0/extensions/x86_64-linux/2.5.0/passenger-5.3.5/gem_make.out
  • How can we reproduce it?
    Vagrantfile for reproduction:
Vagrant.configure("2") do |config|
  config.vm.box = "generic/alpine38"
  config.vm.guest = "alpine"

  config.vm.provision "shell", inline: <<-SHELL
    apk update
    apk upgrade
    apk add ruby make wget linux-headers gcc g++ zlib-dev curl-dev pcre-dev
    gem install --no-document passenger
  SHELL
end

Question 2: Passenger version and integration mode:

  • open source 5.3.5 rubygems

Question 3: OS or Linux distro, platform (including version):

  • alpine linux 3.8 in vagrant 2.1.5 on macos 10.14

Question 4: Passenger installation method:

Your answer:
[ ] RubyGems + Gemfile
[x] RubyGems, no Gemfile
[ ] Phusion APT repo
[ ] Phusion YUM repo
[ ] OS X Homebrew
[ ] source tarball
[ ] Other, please specify:

Question 5: Your app's programming language (including any version managers) and framework (including versions):

  • ruby 2.5.1p57

uestion 6: Are you using a PaaS and/or containerization? If so which one?**

  • vagrant 2.1.5

Question 7: Anything else about your setup that we should know?

  • no
@FooBarWidget
Copy link
Member

FooBarWidget commented Oct 3, 2018

This isn't a problem in Passenger. You need to install the ruby-etc package: https://pkgs.alpinelinux.org/package/edge/main/x86/ruby-etc

@FooBarWidget FooBarWidget changed the title 'gem install passenger' fails on Alpine Linux 3.8 Not a Passenger problem (was: 'gem install passenger' fails on Alpine Linux 3.8) Oct 3, 2018
@aarontc
Copy link

aarontc commented Aug 2, 2019

Sorry if this is the wrong approach, I know this issue is closed... but I think there is a genuine bug here: The passenger gem should declare a dependency on the etc gem. Not having that dependency declared led to this issue and maybe others.

@CamJN
Copy link
Contributor

CamJN commented Aug 2, 2019

The etc package isn't a gem, it's an alpine linux package. We do not package for alpine linux and therefore have nowhere to declare this dependency.

@aarontc
Copy link

aarontc commented Aug 3, 2019

The etc package isn't a gem, it's an alpine linux package. We do not package for alpine linux and therefore have nowhere to declare this dependency.

Hmm I'm not sure I agree. There are lines with require 'etc' in the Passenger codebase (such as

)

There's a Gem on rubygems: https://rubygems.org/gems/etc

$ gem install etc
Fetching: etc-1.0.1.gem (100%)
Building native extensions. This could take a while...
Successfully installed etc-1.0.1
Parsing documentation for etc-1.0.1
Installing ri documentation for etc-1.0.1
Done installing documentation for etc after 0 seconds
1 gem installed

It seems like adding a dependency declaration at

s.add_dependency 'rake', '>= 0.8.1'
would be a way to address this.

@CamJN
Copy link
Contributor

CamJN commented Oct 29, 2019

the 'etc' gem seems like it's supposed to be installed by default for that ruby version: https://ruby-doc.org/stdlib-2.5.1/libdoc/etc/rdoc/Etc.html

That said, it might be a good idea to add the dep for potentially unconventional installs.

@CamJN
Copy link
Contributor

CamJN commented Jun 15, 2020

@aarontc it seems adding the etc gem as a dependency has caused issues for ruby installs that correctly include it by default: #2283 Do you have any suggestions for how we might resolve that, otherwise I'm going to revert the change in the next version and people with ruby installs that are missing default gems will just have to fix them.

@aarontc
Copy link

aarontc commented Jun 15, 2020

@CamJN I'm not sure why #2283 has an issue, since there's no version requirement being declared by the Passenger gemspec... could indicate another bug elsewhere in the tooling. Nonetheless, it seems simpler at this point to approach the alpine team and report a bug in their ruby packaging, while removing the dependency from Passenger. 😞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants