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

PDK broken on Mac M2 #1353

Open
Rudis1261 opened this issue May 9, 2024 · 3 comments
Open

PDK broken on Mac M2 #1353

Rudis1261 opened this issue May 9, 2024 · 3 comments
Labels
bug needs-triage Newly created issue that has not been reviewed by a PDK contributor

Comments

@Rudis1261
Copy link

Describe the bug
I cannot use PDK on a mac M2, looking for options / workarounds to the issue.

To Reproduce
Use a Mac M2, install pdk with homebrew as per the documentation, run any pdk command

Expected behavior
I should be able to run pdk commands, update, linting etc

Additional context

  • Installed via homebrew
  • Your PDK version (pdk --version): 3.0.1
  • Your operating system / platform: Sonoma 14.3.1

I receive this error when attempting to run a command:

-> pdk update
Ignoring bigdecimal-3.1.4 because its extensions are not built. Try: gem pristine bigdecimal --version 3.1.4
Ignoring bootsnap-1.17.0 because its extensions are not built. Try: gem pristine bootsnap --version 1.17.0
Ignoring debug-1.9.2 because its extensions are not built. Try: gem pristine debug --version 1.9.2
Ignoring oj-3.16.3 because its extensions are not built. Try: gem pristine oj --version 3.16.3
Ignoring prism-0.27.0 because its extensions are not built. Try: gem pristine prism --version 0.27.0
Ignoring psych-5.1.1.1 because its extensions are not built. Try: gem pristine psych --version 5.1.1.1
Ignoring puma-6.4.0 because its extensions are not built. Try: gem pristine puma --version 6.4.0
Ignoring racc-1.7.2 because its extensions are not built. Try: gem pristine racc --version 1.7.2
Ignoring stringio-3.0.8 because its extensions are not built. Try: gem pristine stringio --version 3.0.8
Ignoring stringio-3.0.8 because its extensions are not built. Try: gem pristine stringio --version 3.0.8
/opt/puppetlabs/pdk/private/ruby/3.2.2/lib/ruby/3.2.0/yaml.rb:3: warning: It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
/opt/puppetlabs/pdk/private/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/pdk-3.0.1/lib/pdk/config/yaml.rb:25:in `rescue in parse_file': uninitialized constant Psych::SyntaxError (NameError)

      rescue Psych::SyntaxError => e
                  ^^^^^^^^^^^^^
Did you mean?  ScanError
        from /opt/puppetlabs/pdk/private/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/pdk-3.0.1/lib/pdk/config/yaml.rb:9:in `parse_file'
        from /opt/puppetlabs/pdk/private/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/pdk-3.0.1/lib/pdk/config/namespace.rb:353:in `settings'
        from /opt/puppetlabs/pdk/private/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/pdk-3.0.1/lib/pdk/config/namespace.rb:100:in `[]'
        from /opt/puppetlabs/pdk/private/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/pdk-3.0.1/lib/pdk/config.rb:285:in `traverse_object'
        from /opt/puppetlabs/pdk/private/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/pdk-3.0.1/lib/pdk/config.rb:292:in `traverse_object'
        from /opt/puppetlabs/pdk/private/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/pdk-3.0.1/lib/pdk/config.rb:155:in `block in get_within_scopes'
        from /opt/puppetlabs/pdk/private/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/pdk-3.0.1/lib/pdk/config.rb:154:in `each'
        from /opt/puppetlabs/pdk/private/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/pdk-3.0.1/lib/pdk/config.rb:154:in `get_within_scopes'
        from /opt/puppetlabs/pdk/private/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/pdk-3.0.1/lib/pdk.rb:65:in `analytics'
        from /opt/puppetlabs/pdk/private/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/pdk-3.0.1/lib/pdk/cli/util.rb:283:in `analytics_screen_view'
        from /opt/puppetlabs/pdk/private/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/pdk-3.0.1/lib/pdk/cli/update.rb:34:in `block (2 levels) in <module:CLI>'
        from /opt/puppetlabs/pdk/private/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/cri-2.15.11/lib/cri/command.rb:362:in `run_this'
        from /opt/puppetlabs/pdk/private/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/cri-2.15.11/lib/cri/command.rb:298:in `run'
        from /opt/puppetlabs/pdk/private/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/cri-2.15.11/lib/cri/command.rb:316:in `run'
        from /opt/puppetlabs/pdk/private/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/pdk-3.0.1/lib/pdk/cli.rb:60:in `run'
        from /opt/puppetlabs/pdk/private/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/pdk-3.0.1/exe/pdk:6:in `<top (required)>'
        from /opt/puppetlabs/pdk/private/ruby/3.2.2/bin/pdk:25:in `load'
        from /opt/puppetlabs/pdk/private/ruby/3.2.2/bin/pdk:25:in `<main>'
<internal:/opt/puppetlabs/pdk/private/ruby/3.2.2/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:148:in `require': dlopen(/Users/rudistrydom/.gem/ruby/3.2.0/gems/psych-5.1.1.1/lib/psych.bundle, 0x0009): tried: '/Users/rudistrydom/.gem/ruby/3.2.0/gems/psych-5.1.1.1/lib/psych.bundle' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/rudistrydom/.gem/ruby/3.2.0/gems/psych-5.1.1.1/lib/psych.bundle' (no such file), '/Users/rudistrydom/.gem/ruby/3.2.0/gems/psych-5.1.1.1/lib/psych.bundle' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')) - /Users/rudistrydom/.gem/ruby/3.2.0/gems/psych-5.1.1.1/lib/psych.bundle (LoadError)
        from <internal:/opt/puppetlabs/pdk/private/ruby/3.2.2/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:148:in `require'
        from /Users/rudistrydom/.gem/ruby/3.2.0/gems/psych-5.1.1.1/lib/psych.rb:13:in `<top (required)>'
        from <internal:/opt/puppetlabs/pdk/private/ruby/3.2.2/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:148:in `require'
        from <internal:/opt/puppetlabs/pdk/private/ruby/3.2.2/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:148:in `require'
        from /opt/puppetlabs/pdk/private/ruby/3.2.2/lib/ruby/3.2.0/yaml.rb:4:in `<top (required)>'
        from <internal:/opt/puppetlabs/pdk/private/ruby/3.2.2/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/opt/puppetlabs/pdk/private/ruby/3.2.2/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /opt/puppetlabs/pdk/private/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/pdk-3.0.1/lib/pdk/config/yaml.rb:15:in `parse_file'
        from /opt/puppetlabs/pdk/private/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/pdk-3.0.1/lib/pdk/config/namespace.rb:353:in `settings'
        from /opt/puppetlabs/pdk/private/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/pdk-3.0.1/lib/pdk/config/namespace.rb:100:in `[]'
        from /opt/puppetlabs/pdk/private/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/pdk-3.0.1/lib/pdk/config.rb:285:in `traverse_object'
        from /opt/puppetlabs/pdk/private/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/pdk-3.0.1/lib/pdk/config.rb:292:in `traverse_object'
        from /opt/puppetlabs/pdk/private/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/pdk-3.0.1/lib/pdk/config.rb:155:in `block in get_within_scopes'
        from /opt/puppetlabs/pdk/private/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/pdk-3.0.1/lib/pdk/config.rb:154:in `each'
        from /opt/puppetlabs/pdk/private/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/pdk-3.0.1/lib/pdk/config.rb:154:in `get_within_scopes'
        from /opt/puppetlabs/pdk/private/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/pdk-3.0.1/lib/pdk.rb:65:in `analytics'
        from /opt/puppetlabs/pdk/private/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/pdk-3.0.1/lib/pdk/cli/util.rb:283:in `analytics_screen_view'
        from /opt/puppetlabs/pdk/private/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/pdk-3.0.1/lib/pdk/cli/update.rb:34:in `block (2 levels) in <module:CLI>'
        from /opt/puppetlabs/pdk/private/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/cri-2.15.11/lib/cri/command.rb:362:in `run_this'
        from /opt/puppetlabs/pdk/private/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/cri-2.15.11/lib/cri/command.rb:298:in `run'
        from /opt/puppetlabs/pdk/private/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/cri-2.15.11/lib/cri/command.rb:316:in `run'
        from /opt/puppetlabs/pdk/private/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/pdk-3.0.1/lib/pdk/cli.rb:60:in `run'
        from /opt/puppetlabs/pdk/private/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/pdk-3.0.1/exe/pdk:6:in `<top (required)>'
        from /opt/puppetlabs/pdk/private/ruby/3.2.2/bin/pdk:25:in `load'
        from /opt/puppetlabs/pdk/private/ruby/3.2.2/bin/pdk:25:in `<main>'
@Rudis1261 Rudis1261 added bug needs-triage Newly created issue that has not been reviewed by a PDK contributor labels May 9, 2024
@Rudis1261
Copy link
Author

Rudis1261 commented May 9, 2024

Installing PDK via the pkg install seems to have resolved my issue, this uses ruby 3.2.3.

https://www.puppet.com/downloads/puppet-development-kit

@Rudis1261
Copy link
Author

Nope, hitting the error when our precommit hooks does yaml linting

@danadoherty639
Copy link
Contributor

@Rudis1261 thank you for bringing this top our attention, we have raised a ticket and will look into this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs-triage Newly created issue that has not been reviewed by a PDK contributor
Projects
Archived in project
Development

No branches or pull requests

2 participants