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

"gem install fpm" is not sufficient to have fpm correctly installed #2043

Open
avivace opened this issue Dec 21, 2023 · 1 comment
Open

"gem install fpm" is not sufficient to have fpm correctly installed #2043

avivace opened this issue Dec 21, 2023 · 1 comment

Comments

@avivace
Copy link

avivace commented Dec 21, 2023

I'm working on a base container image to run FPM and, following the Install instructions, it may seem that gem install fpm on a system where Ruby is installed is enough.

That's false. The ruby json gem is needed and the rpm-build system package are pre-requisites.

@jordansissel
Copy link
Owner

Thanks for the report! Sounds like we can improve the docs a bit to help in the future :)

Focusing on specific points:

json gem:

Interesting! I haven't needed to install the json gem in years as it comes with all recent Ruby installations that I've used. If we can document this better, I'm happy to learn about it.

To my knowledge, the json gem is part of Ruby's standard library and has been since Ruby 1.9 (see also: #1950). At some point this became part of the "default gem" set somewhere in the 2.x series of Ruby. There is a json gem, though as a "default gem" I haven't tried upgrading or uninstalling it. You'd need to install the json gem for Ruby 1.8, but that is an extremely old Ruby and likely a rare use case as far as I can tell.

Can you provide more details about your container? How are you installing Ruby, and what version? I'd like to help figure out what's causing this problem.

rpm-build

For building rpms, you are right that the rpmbuild tool is needed. I've found it difficult to document this kind of thing, and it's not needed for folks who are building only debian packages, for example.

It's likely that the docs could be improved to better provider new users with a successful path for installing fpm and any dependencies they'd need.

There is a small bit of documentation regarding dependencies needed for certain package types (rpm, snap). I'd love for this to be improved for other package types and making this stuff more discoverable.

When running, if fpm needs a tool and finds that it is missing, I've tried to make fpm provide an actionable error message indicating that a dependency is missing for a particular package type. In cases where the environment can be modified, this kind of feedback is usually actionable (fpm cannot build rpms because rpmbuild is missing, user installs a dependency, problem resolved). However, in your case, you'd want all possible dependencies installed.

As for docker, we have some documentation and tooling for building fpm for a container which might help you further - https://fpm.readthedocs.io/en/v1.15.1/docker.html - I haven't tested this in a while, but the goal is to provide a way to build a container with fpm and any needed dependencies. Even if the tooling doesn't help, the Dockerfile might be of use to you.

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

No branches or pull requests

2 participants