Open asgeirn opened 9 months ago
I'm seeing the same problem as well.
We have RHEL7 systems running system ruby as 2.6. These are now failing to install fpm:
gem install -N fpm
ERROR: Error installing fpm:
The last version of dotenv (>= 0) to support your Ruby & RubyGems was 2.8.1. Try installing it with `gem install dotenv -v 2.8.1` and then running the current command again
dotenv requires Ruby version >= 3.0. The current ruby version is 2.6.10.210.
Trying to pin the version of dotenv like the error suggest doesn't work. If I manually install dotenv 2.8.1 as the error suggest and try to install fpm again, it still fails:
gem install -N dotenv -v 2.8.1
Fetching dotenv-2.8.1.gem
Successfully installed dotenv-2.8.1
1 gem installed
gem install -N fpm
ERROR: Error installing fpm:
dotenv requires Ruby version >= 3.0. The current ruby version is 2.6.10.210.
We also have RHEL8 systems running system ruby 2.7 and this is happening on those as well:
gem install -N fpm
ERROR: Error installing fpm:
dotenv requires Ruby version >= 3.0. The current ruby version is 2.7.8.225.
It looks like fpm is making dotenv 3.0.0 a hard requirement for some reason:
gem install --explain -N fpm
Gems to install:
rexml-3.2.6
stud-0.0.23
dotenv-3.0.0
insist-1.0.0
mustache-0.99.8
clamp-1.0.1
cabin-0.9.0
pleaserun-0.0.32
arr-pm-0.0.12
backports-3.24.1
fpm-1.15.1
fpm has a dependency on pleaserun. pleaserun is making the newest version of dotenv a hard requirement.
Relevant Issue from pleaserun https://github.com/jordansissel/pleaserun/issues/153
Perhaps pleaserun could be an optional dependency for fpm?
This also an issue in amazon linux 2 as ruby is 2.6 so would be nice to have dotenv version as 2.8.1 and up.
fpm has a dependency on pleaserun. pleaserun is making the newest version of dotenv a hard requirement.
causing problems since 2022 as far as I can see..
For those interested, I've created forks of pleaserun
and fpm
to lock the dotenv
version to one compatible with Ruby 2.
How to use:
packages:read
permissiongem sources --add https://${USERNAME}:${TOKEN}@rubygems.pkg.github.com/asgeirn/
gem install --no-document fpm --version "1.15.1042"
@asgeirn thanks for providing a workaround!
I’ll look into pleaserun’s dotenv dependency a bit more and see about removing that dependency soon.
Ran into this as well; the behavior is strange as it almost seems like a bug in ruby gems. I can get fpm to install fairly easily on CentOS 7 (ruby 2.0, gem 2.0.14.1) with:
gem install dotenv -v 2.8.1 -N
gem install rexml -v 3.2.4 -N
gem install backports -v 3.21.0 -N
gem install fpm -N
But on Rocky Linux 8 (ruby 2.5, gem 2.7.6.3), even if I install dotenv first, it still tries to install the latest, even if the installed dotenv meets the requirements of pleaserun:
# gem install dotenv -v 2.8.1 -N
Fetching: dotenv-2.8.1.gem (100%)
Successfully installed dotenv-2.8.1
1 gem installed
# gem install fpm -N
Fetching: rexml-3.2.6.gem (100%)
Successfully installed rexml-3.2.6
Fetching: stud-0.0.23.gem (100%)
Successfully installed stud-0.0.23
Fetching: dotenv-3.1.0.gem (100%)
ERROR: Error installing fpm:
dotenv requires Ruby version >= 3.0. The current ruby version is 2.5.0.
Even with flags that I thought should explicitly tell it not to upgrade deps that already meet the requirements (though I've never had to use these in the past; that seems to be the default behavior:
# gem install fpm -N --conservative --minimal-deps
ERROR: Error installing fpm:
dotenv requires Ruby version >= 3.0. The current ruby version is 2.5.0.
My workaround for installing on EL 8; basically just explicitly install the dependencies of pleaserun and fpm and then install those without any deps:
gem install dotenv -v 2.8.1 -N
gem install clamp -v 1.0.1 -N
gem install mustache -v 0.99.8 -N
gem install cabin insist stud arr-pm backports rexml -N
gem install pleaserun --ignore-dependencies -N
gem install fpm --ignore-dependencies -N
I got the same error, and I was able to workaround it by using more recent Ubuntu version:
# Base container is used for various release and test things
FROM ubuntu:22.04 as minimal-base
Also ubuntu:24:04
is working fine.
Another workaround for Rocky 8 (and most likely all RHEL 8 variants) is to specify a gems.rb
file with the version of dotenv
pinned. This forces gem install
to use the correct version of dotenv
, but allows all other dependencies of fpm
to be resolved automatically. This has the advantage of eliminating --ignore-dependencies
and any potential breakage that may occur from that.
You can install fpm
by running gem install --no-document --file gems.rb
with the following gems.rb file:
source 'https://rubygems.org'
gem 'dotenv', '= 2.8.1'
gem 'fpm', '= 1.15.1'