I've installed Ruby in a custom location (on an Ubuntu box, into /opt/rubies using ruby-install) and when it comes to declarations like this:
package { 'bundler':
ensure => 'installed',
provider => 'gem',
require => Exec["Install Ruby"],
}
They fail (or install for the wrong version of Ruby) because it's looking for the Rubygems' gem
command in the wrong place (/usr/bin). I can think of a few ways I might fix this:
package
which version of gem
I want used, but I don't see anything in the docs for that.exec
declaration instead.Obviously, using package
is very convenient so any way to keep using that would be my preference.
If you want to keep using package
, you have two options:
PATH
that the puppet agent runs on.gem
path. Like this, except you don't need to replace the uninstall
method, so you can lose that part. Then you'll change provider => gem
to provider => whatever_provider_name_you_chose
.