Skip to content

Unable to install latest knife gem using Ruby bundled with chef workstation #2989

@jasonwbarnett

Description

@jasonwbarnett

Description

Since the recent changes made here, it isn't possible to install the knife gem using Ruby 3.0.3 which is the version of Ruby that ships with the latest version of the Chef Workstation.

Chef Workstation Version

Chef Workstation: 22.10.1013
Ruby Version (embedded in Chef Workstation): 3.0.3p157

Platform Version

  • Red Hat Enterprise Linux 7

Replication Case

  1. Install the latest Chef Workstation (i.e. 22.10.1013)

  2. Create local script, /tmp/script.sh

    #!/bin/bash
    
    mkdir /tmp/knife-issue
    
    cd /tmp/knife-issue
    
    cat > /tmp/knife-issue/Gemfile <<'EOF'
    source "https://rubygems.org/"
    
    gem "chef", "~> 18.0"
    gem "knife", "~> 18.0"
    EOF
    
    /opt/chef-workstation/embedded/bin/bundle install
  3. Execute script

    bash -x /tmp/script.sh

Bundler Output

Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Resolving dependencies...
Bundler found conflicting requirements for the Ruby version:
  In Gemfile:
    knife (~> 18.0) was resolved to 18.0.185, which depends on
      Ruby (>= 3.1.0)

  Current Ruby version:
    Ruby (= 3.0.3)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: UntriagedAn issue that has yet to be triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions