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:
- Tell packagewhich version ofgemI want used, but I don't see anything in the docs for that.
- Add the correct bin directory to the PATH, but I don't know which user is running the provisioner and hence, where to change the PATH. Or should I change the path along with the Ruby installation?
- Using an execdeclaration instead.
Obviously, using package is very convenient so any way to keep using that would be my preference. Any help or insight will be much appreciated.
 
                        
If you want to keep using
package, you have two options:PATHthat the puppet agent runs on.gempath. Like this, except you don't need to replace theuninstallmethod, so you can lose that part. Then you'll changeprovider => gemtoprovider => whatever_provider_name_you_chose.