puppetlabs / pdk

The shortest path to better modules: Puppet Development Kit; Download:
https://puppet.com/download-puppet-development-kit
Apache License 2.0
225 stars 105 forks source link

Fatal Errors when trying to install missing gems during a pdk convert / validate #1244

Open jgiorio opened 1 year ago

jgiorio commented 1 year ago

Describe the bug I am getting fatal errors when trying to run pdk convert on modules on Win 11. There is usually one or two gems required which have Native extensions and they fail to install. The error message states to run 'gem install ' which occurs successfully but the resulting attempt to run pdk validate returns the same exact error.

To Reproduce After installing a new version of the pdk... from 1.8.1 to 2.6.1 or 2.7.1, I run pdk convert on a module. It fails to install some gems with native extensions. I have attached a bunch of files to illustrate what is going on. the metadata_before and gemfile_before show what was in those files before I ran pdk convert. After shows what is in it after. The Convert output shows the command line output of running pdk convert and how it fails on the rainbow gem. and I also provided the generated convert_report.txt in case it helps.

Expected behavior Better error message which states how to resolve the issue. Current message gives misleading commands to run.

Additional context

Gemfile_before.txt PDK_Convert_output.txt metadata_before.txt convert_report.txt metadata_after.txt Gemfile_after.txt

jmichaels42 commented 1 year ago

I was able to work around this by installing the same version of Ruby (w/ dev kit) included in PDK (that doesn't have dev kit). I am using PDK 2.7.1. In my case, it was the gem nokogiri that was failing to compile, so I used the Ruby w/ dev kit to compile the gem into the directory where PDK can use it:

This now will work: pdk bundle install