garethr / puppet-module-skeleton

A pretty opinionated skeleton for writing your own puppet modules
Apache License 2.0
308 stars 153 forks source link

Default Gemfile (Puppet 3.8) not Ruby 2.2 Compatible #122

Open big-samantha opened 8 years ago

big-samantha commented 8 years ago

When creating a new module with p-m-s, out of the box the Gemfile is broken for Ruby 2.2.

This is because Puppet 3.x attempts to call Psck in a bunch of cases, but Psyk is totally gone (e.g. you can't require 'psyk' anymore) in Ruby 2.2 and newer.

LOLcalhost :: Working/Misc/puppet ‹master› % gco 3.8.7
Note: checking out '3.8.7'.
LOLcalhost :: Working/Misc/puppet ‹74c9754› % grep -ri -E 'require.*syck.*' ./
./lib/puppet/vendor/safe_yaml/lib/safe_yaml.rb:require "safe_yaml/syck_hack" if defined?(JRUBY_VERSION)
./lib/puppet/vendor/safe_yaml/lib/safe_yaml.rb:    require "safe_yaml/syck_resolver"
./lib/puppet/vendor/safe_yaml/lib/safe_yaml.rb:    require "safe_yaml/syck_node_monkeypatch"
./lib/puppet/vendor/safe_yaml/README.md:SafeYAML requires Ruby 1.8.7 or newer and works with both [Syck](http://www.ruby-doc.org/stdlib-1.8.7/libdoc/yaml/rdoc/YAML.html) and [Psych](http://github.com/tenderlove/psych).
./lib/puppet/vendor/safe_yaml/spec/syck_resolver_spec.rb:  require "safe_yaml/syck_resolver"

Maybe default to Puppet 4 at this point, and people can adjust the Gemfile if they need to move to an older Puppet? E.g. you'll need to use an older Ruby as well.

Or, if defaulting to 4 isn't sane, maybe some guidance in the README around this issue? I'd be happy to contribute it if you think that's the better approach.

deric commented 7 years ago

Ruby 2.1 is getting closer to end of lifetime. I think it's time to switch at least to Ruby 2.2 which means using Puppet 4.