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

Cannot load puppet_blacksmith on fresh module #503

Closed
danielparks opened this issue Mar 20, 2023 · 3 comments · Fixed by #518
Closed

Cannot load puppet_blacksmith on fresh module #503

danielparks opened this issue Mar 20, 2023 · 3 comments · Fixed by #518
Labels

Comments

@danielparks
Copy link

Describe the Bug

When I create a new module and run pdk bundle exec rake -T I get an error that it cannot load puppet_blacksmith/rake_tasks. Other commands that internally use rake are also broken in the same way, e.g. pdk test unit.

I haven’t spent much time working with Ruby in recent years, so this may be some sort of misconfiguration on my system. I have puppet-blacksmith 6.1.1 installed in Ruby 3.1.2 (I’m using rbenv), but I don’t think pdk uses that installation at all — it reports it’s using Ruby 2.7.7 which I do not have installed in rbenv.

It does not appear that puppet-blacksmith is installed in PDK’s Ruby:

❯ pdk bundle exec gem list | fgrep blacksmith
pdk (INFO): Using Ruby 2.7.7
pdk (INFO): Using Puppet 7.23.0
❯

Expected Behavior

Standard commands run without error on a fresh install.

Steps to Reproduce

❯ pdk new module --template-url https://github.com/puppetlabs/pdk-templates --skip-interview dp-foobar foobar
[ . . . success . . . ]
❯ cd foobar
❯ pdk bundle exec rake -T
pdk (INFO): Using Ruby 2.7.7
pdk (INFO): Using Puppet 7.23.0
rake aborted!
LoadError: cannot load such file -- puppet_blacksmith/rake_tasks
/private/var/folders/sv/dc8kthjs671dqhnn363v1hfr0000gn/T/tmp.umZzNww6/foobar/Rakefile:7:in `require'
/private/var/folders/sv/dc8kthjs671dqhnn363v1hfr0000gn/T/tmp.umZzNww6/foobar/Rakefile:7:in `<top (required)>'
/opt/puppetlabs/pdk/share/cache/ruby/2.7.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/opt/puppetlabs/pdk/private/ruby/2.7.7/bin/bundle:23:in `load'
/opt/puppetlabs/pdk/private/ruby/2.7.7/bin/bundle:23:in `<main>'
(See full trace by running task with --trace)

Environment

  • PDK 2.7.0
  • macOS 13.2.1
@ardrigh
Copy link
Contributor

ardrigh commented Mar 21, 2023

The suggested fix for this specific error given on Slack was rm -rf ~/.pdk/cache/ruby.

Hope this helps.

@danielparks
Copy link
Author

rm -rf ~/.pdk/cache/ruby && pdk bundle install worked. Thanks!

Given that the fix was PDK-specific, this seems like an actual issue with PDK rather than my configuration.

@PaulSD
Copy link

PaulSD commented Apr 16, 2023

This is fixed by #507

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants