Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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)

share|improve this question

2 Answers 2

class rails::rvm {
    package { [ "autoconf",
                "bison",
                "curl",
                "libreadline-dev",
                "subversion",
                "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",
}
}
share|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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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