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_package reports gem as installed when it is not. #12879
Comments
Digging a bit further I found my gems to be installed here: But I would expect them to be installed here: |
Could you let us know if you are trying to run chef-client from workstation when you see this error or is there a separate install of chef-client, if so what is the version of chef-client that is being run on the system? Have you tried nuking the |
I'm running chef-client from my chef-workstation installation. The version of chef-client is the one shipped with workstation Clearing the |
chef-17.10.0 is the version of chef that is installed with workstation 22.5.923. |
@fasmat Can you check both the Gem Path and the hard drive more broadly to see if that gem is lying around somewhere else? I'm curious why chef reports it installed but gem list isn't showing it. This is a new issue so we're a bit confused. |
information about used chef versions: vagrant@test-vm:~$ chef --version
Chef Workstation version: 22.5.923
Test Kitchen version: 3.2.2
Cookstyle version: 7.32.1
Chef Infra Client version: 17.10.0
Chef InSpec version: 4.56.20
Chef CLI version: 5.6.1
Chef Habitat version: 1.6.420 my vagrant@test-vm:~$ sudo gem environment
RubyGems Environment:
- RUBYGEMS VERSION: 3.3.5
- RUBY VERSION: 3.0.2 (2021-07-07 patchlevel 107) [x86_64-linux-gnu]
- INSTALLATION DIRECTORY: /var/lib/gems/3.0.0
- USER INSTALLATION DIRECTORY: /root/.local/share/gem/ruby/3.0.0
- RUBY EXECUTABLE: /usr/bin/ruby3.0
- GIT EXECUTABLE: /usr/bin/git
- EXECUTABLE DIRECTORY: /usr/local/bin
- SPEC CACHE DIRECTORY: /root/.local/share/gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /var/lib/gems/3.0.0
- /root/.local/share/gem/ruby/3.0.0
- /usr/local/lib/ruby/gems/3.0.0
- /usr/lib/ruby/gems/3.0.0
- /usr/lib/x86_64-linux-gnu/ruby/gems/3.0.0
- /usr/share/rubygems-integration/3.0.0
- /usr/share/rubygems-integration/all
- /usr/lib/x86_64-linux-gnu/rubygems-integration/3.0.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /usr/local/sbin
- /usr/local/bin
- /usr/sbin
- /usr/bin
- /sbin
- /bin
- /snap/bin
I temporarily fixed my issue by replacing the following code in my recipe: gem_package "bcrypt_pbkdf" do
gem_binary "/usr/bin/gem"
version "~>1.1"
action :install
end with execute "installing gem bcrypt_pbkdf" do
command "gem install bcrpt_pbkdf --version '~>1.1'"
not_if "gem list bcrypt_pbkdf -i -v '~>1.1'"
end which does exactly what I want to do: install a gem system wide for all users unless it is already installed. |
Description
I'm trying to install a gem with chef via
gem_package
but fail to do so on Ubuntu 22.04Chef Version
22.5.923
Platform Version
Ubuntu 22.04
Replication Case
I have the following code in one of my recipes:
Client Output
The gem is installed according to chef:
But checking for it shows that it is not there:
This issue appears with all gems that I try to install. Chef reports them to be already installed, but they are actually not there.
Any suggestions as to what could be the issue?
The text was updated successfully, but these errors were encountered: