I'm currently digging deeper into Puppet and with several manifests I encounter problems regarding the installed ruby version or rubygems. I would guess that others probably also run in such problems. As I couldn't find the right pointers via Google, I'd like to ask if someone has a good example on using RVM with Puppet and run Bundler and Passenger inside a specific gemset provided by RVM.

I tried puppet-rvm from blt04 but it doesn't help running bundler inside a RVM gemset and I couldn't find information on configuring ruby applications to be run inside the RVM context (e.g. using a project .rvmrc)

class rails::rvm {
    package { [ "autoconf",
                "zlib1g-dev" ]: ensure => installed }

file { "/usr/local/bin/rvm-install-system-wide":
    source => "puppet:///modules/rails/rvm-install-system-wide",
    mode => "700",

exec { "install-rvm":
    command => "/usr/local/bin/rvm-install-system-wide",
    creates => "/usr/local/bin/rvm",
    require => [ Package["curl"], Package["subversion"], File["/usr/ local/bin/rvm install-system-wide"] ],
    logoutput => on_failure,

append_if_no_such_line { "setup-rvm-shell-environment":
    file => "/etc/bash.bashrc",
    line => "[[ -s /usr/local/rvm/scripts/rvm ]] && . /usr/local/ rvm/scripts/rvm",
| improve this answer | |
  • I don't understand your answer. I guess the magic happens in puppet:///modules/rails/rvm-install-system-wide but I don't have that file. Which rails module do you use? How does this help running bundler or ruby applications within a RVM gemset? – Florian Feldhaus Aug 22 '12 at 16:39

What I do is add the users that will need to run rvm to the rvm group, and then prefix all execs with rvm do. Take a look at my gitorious module -- there's rvm stuff all over the place.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.