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

Failing to install rbenv on CentOS 9 #335

Open
pantras opened this issue Sep 10, 2024 · 1 comment
Open

Failing to install rbenv on CentOS 9 #335

pantras opened this issue Sep 10, 2024 · 1 comment

Comments

@pantras
Copy link

pantras commented Sep 10, 2024

πŸ‘» Brief Description

The cookbook tries to install gdbm-devel which is not available on CentOS 9.

πŸ₯ž Cookbook version

ruby_rbenv (5.0.21) - latest

πŸ‘©β€πŸ³ Chef-Infra Version

System Info:
------------
chef_version=18.5.0
platform=centos
platform_version=9
ruby=ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
program_name=/opt/chef/bin/chef-client
executable=/opt/chef/bin/chef-client

🎩 Platform details

Operating System: CentOS Stream 9
CPE OS Name: cpe:/o:centos:centos:9
Kernel: Linux 5.14.0-480.el9.x86_64
Architecture: x86-64

Steps To Reproduce

Converge a centos-9 platform using ruby_rbenv cookbook to install Ruby.

πŸš“ Expected behavior

Successful installation

βž•

Chef::Exceptions::Package
-------------------------
dnf_package[gdbm-devel] (aspera-qa-agent::rbenv line 10) had an error: Chef::Exceptions::Package: No candidate version available for gdbm-devel

Cookbook Trace: (most recent call first)
----------------------------------------
/tmp/kitchen/cache/cookbooks/ruby_rbenv/libraries/package_deps.rb:10:in `block in install_ruby_dependencies'
/tmp/kitchen/cache/cookbooks/ruby_rbenv/libraries/package_deps.rb:9:in `each'
/tmp/kitchen/cache/cookbooks/ruby_rbenv/libraries/package_deps.rb:9:in `install_ruby_dependencies'
/tmp/kitchen/cache/cookbooks/ruby_rbenv/resources/ruby.rb:64:in `block in class_from_file'

Compiled Resource:
------------------
# Declared in /tmp/kitchen/cache/cookbooks/aspera-qa-agent/recipes/rbenv.rb:29:in `from_file'

rbenv_ruby("3.1.3") do
  action [:install]
  updated true
  updated_by_last_action true
  default_guard_interpreter :default
  declared_type :rbenv_ruby
  cookbook_name "aspera-qa-agent"
  recipe_name "rbenv"
  ruby_build_git_url "https://github.com/rbenv/ruby-build.git"
end

βž•

The package is not part of the default repository and can be installed from CodeReady Linux Builder (CRB).
sudo dnf --enablerepo=crb -y install gdbm-devel.

@pantras
Copy link
Author

pantras commented Sep 10, 2024

A workaround is to pre-install the gdbm-devel package (and also libyaml-devel for Ruby 3.3.3) from the CRB adding the following to the platform description in the kitchen.yml file:

    lifecycle:
      pre_converge:
      - remote: sudo dnf --enablerepo=crb -y install gdbm-devel libyaml-devel

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

1 participant