Interestingly, I ran this on a pretty clean Ubuntu 12.04 slide, and it only installed version 277.
Also I do not think the package resource can do this for you. You could handle it in exec, for example:
exec { 'remove-sass-3.3.0.alpha.212': command => 'gem uninstall sass -v=3.3.0.alpha.212', unless => 'test `gem list --local | grep -q 3.3.0.alpha.212; echo $?` -ne 0', path => ['/usr/bin', '/bin'], }
You can even wrap it as a specific type:
define remove-gem ($version) { exec { "remove-gem-${name}-version-${version}": command => "gem uninstall ${name} -v=${version}", unless => "test `gem list --local | grep -q \"${name}.*${version}\"; echo $?` -ne 0", path => ['/usr/bin', '/bin'], } } remove-gem {'sass': version => '3.3.0.alpha.212', }
this way you can reuse it to remove other specific versions of gem.
source share