Giter Site home page Giter Site logo

voxpupuli / puppet-rvm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from blt04/puppet-rvm

32.0 6.0 102.0 582 KB

A puppet module for installing and using RVM (Ruby Version Manager)

Home Page: https://forge.puppet.com/puppet/rvm

License: BSD 3-Clause "New" or "Revised" License

Ruby 72.95% Puppet 26.33% HTML 0.72%
hacktoberfest centos-puppet-module debian-puppet-module linux-puppet-module oraclelinux-puppet-module puppet redhat-puppet-module scientific-puppet-module sles-puppet-module ubuntu-puppet-module

puppet-rvm's Introduction

Puppet Module for Ruby Version Manager (RVM)

This module handles installing system RVM (also known as multi-user installation as root) and using it to install rubies and gems. Support for installing and configuring passenger is also included.

We are actively using this module. It works well, but does have some issues you should be aware of. Due to the way puppet works, certain resources (rvm_sytem_ruby, rvm_gem and rvm_gemset) may generate errors until RVM is installed. You may want to use run stages to install RVM before the rest of your configuration runs. However, if you run puppet using the --noop parameter, you may see Could not find a default provider errors. See the Troubleshooting section for more information.

Please read the troubleshooting section below before opening an issue.

Add Puppet Module

Before you begin, you must add the RVM module to your Puppet installation. This can be done with:

$ puppet module install puppet/rvm

You may now continue configuring RVM resources.

Install RVM with Puppet

class { 'rvm': }

This will install RVM into /usr/local/rvm.

To use RVM without sudo, users need to be added to the rvm group. This can be easily done with:

rvm::system_user { bturner: ; jdoe: ; jsmith: ; }

If GPG is installed, installing RVM requires the RVM GPG key. This module will install the key if gpg is already installed or being installed with the golja-gnupg module.

If you don't want this module to manage any signing keys, set the signing_keys parameter to []

class { 'rvm': signing_keys => [] }

Installing Ruby

You can tell RVM to install one or more Ruby versions with:

rvm_system_ruby {
  'ruby-1.9':
    ensure      => 'present',
    default_use => true,
    build_opts  => ['--binary'];
  'ruby-2.0':
    ensure      => 'present',
    default_use => false;
}

You should use the full version number. While the shorthand version may work (e.g. '1.9.2'), the provider will be unable to detect if the correct version is installed.

If rvm fails to install binary rubies you can increase curl's timeout with the rvm_max_time_flag in ~/.rvmrc with a fully qualified path to the home directory.

# ensure rvm doesn't timeout finding binary rubies
# the umask line is the default content when installing rvm if file does not exist
file { '/home/user/rvmrc':
  content => 'umask u=rwx,g=rwx,o=rx
              export rvm_max_time_flag=20',
  mode    => '0664',
  before  => Class['rvm'],
}

Or, to configure /etc/rvmrc you can use use Class['rvm::rvmrc]

class{ 'rvm::rvmrc':
  max_time_flag => 20,
  before  => Class['rvm'],
}

Installing JRuby from sources

JRuby has some extra requirements, java, maven and ant that you can install using puppetlabs/java, maestrodev/ant and maestrodev/maven modules.

class { 'java': } ->
class { 'ant': } ->
class { 'maven::maven': } ->
rvm_system_ruby { 'jruby-1.7.6':
  ensure      => 'present',
  default_use => false;
}

Creating Gemsets

Create a gemset with:

rvm_gemset {
  'ruby-1.9.3-p448@myproject':
    ensure  => present,
    require => Rvm_system_ruby['ruby-1.9.3-p448'];
}

Installing Gems

Install a gem with:

rvm_gem {
  'ruby-1.9.3-p448@myproject/bundler':
    ensure  => '1.0.21',
    require => Rvm_gemset['ruby-1.9.3-p448@myproject'];
}

The name of the gem should be <ruby-version>[@<gemset>]/<gemname>. For example, you can install bundler for ruby-1.9.2 using ruby-1.9.3-p448/bundler. You could install rails in your project's gemset with: ruby-1.9.3-p448@myproject/rails.

Alternatively, you can use this more verbose syntax:

rvm_gem {
  'bundler':
    name         => 'bundler',
    ruby_version => 'ruby-1.9.3-p448',
    ensure       => latest,
    require      => Rvm_system_ruby['ruby-1.9.3-p448'];
}

Creating Aliases

To create an RVM alias, you can use:

rvm_alias {
  'myproject':
    target_ruby => 'ruby-1.9.3-p448@myproject',
    ensure      => present,
    require     => Rvm_gemset['ruby-1.9.3-p448@myproject'];
}

Creating Wrappers

To create an RVM wrapper, you can use:

rvm_wrapper {
  'god':
    target_ruby => 'ruby-1.9.3-p448',
    prefix      => 'bootup',
    ensure      => present,
    require     => Rvm_system_ruby['ruby-1.9.3-p448'];
}

Installing Passenger

NOTE: You must install the puppetlabs/apache module by yourself. It is not included as a dependency to this module to avoid installing it when is not needed most times.

Install passenger using the puppetlabs/apache module, and using:

class { 'apache': }
class { 'rvm::passenger::apache':
    version            => '3.0.11',
    ruby_version       => 'ruby-1.9.3-p448',
    mininstances       => 3,
    maxinstancesperapp => 0,
    maxpoolsize        => 30,
    spawnmethod        => 'smart-lv2',
}

Using Hiera

You can configure the ruby versions to be installed and the system users from hiera

rvm::system_rubies:
  'ruby-1.9':
    default_use: true
  'ruby-2.0': {}
  'jruby-1.7': {}

rvm::system_users:
  - john
  - doe

rvm::rvm_gems:
  'bundler':
    name: 'bundler'
    ruby_version: 'ruby-1.9'
    ensure: latest

Building the module

Testing is done with rspec, Beaker-rspec, Beaker)

To test and build the module

bundle install
# run specs
rake

# run Beaker system tests with vagrant vms
rake beaker
# to use other vm from the list spec/acceptance/nodesets and not destroy the vm after the tests
BEAKER_destroy=no BEAKER_set=centos-64-x64 bundle exec rake beaker

# Release the Puppet module to the Forge, doing a clean, build, tag, push, bump_commit and git push
rake module:release

Troubleshooting / FAQ

An error "Could not find a default provider for rvm_system_ruby" is displayed when running Puppet with --noop

This means that puppet cannot find the /usr/local/rvm/bin/rvm command (probably because RVM isn't installed yet). Currently, Puppet does not support making a provider suitable using another resource (late-binding). You may want to use run stages to install RVM before the rest of the configuration runs. When running in noop mode, RVM is not actually installed causing rvm_system_ruby, rvm_gem and rvm_gemset resources to generate this error. You can avoid this error by surrounding your rvm configuration in an if block:

if $rvm_installed == "true" {
    rvm_system_ruby ...
}

Do not surround include rvm in the if block, as this is used to install RVM.

NOTE: $rvm_installed is evaluated at the beginning of each puppet run. If you use this in your manifests, you will need to run puppet twice to fully configure RVM.

Some packages/libraries I don't want or need are installed (e.g. build-essential, libc6-dev, libxml2-dev).

RVM works by compiling Ruby from source. This means you must have all the libraries and binaries required to compile Ruby installed on your system, which is handled by rvm autolibs in newer versions of RVM.

It doesn't work on my operating system.

Check the rspec-system tests as described above to test in a specific OS If that doesn't work feel free to send a pull request ;)

Why didn't you just add an RVM provider for the existing package type?

The puppet package type seems like an obvious place for the RVM provider. It would be nice if the syntax for installing Ruby with RVM looked like:

# NOTE: This does not work
package {'ruby':
    provider => 'rvm',
    ensure => '1.9.2-p290';
}

While this may be possible, it becomes harder to manage multiple Ruby versions and nearly impossible to install gems for a specific Ruby version. For this reason, I decided it was best to create a completely new set of types for RVM.

puppet-rvm's People

Contributors

adamcohen avatar alexjfisher avatar bastelfreak avatar blt04 avatar carlossg avatar edestecd avatar ekohl avatar fritz avatar hakamadare avatar heffergm avatar jlindquist-godaddy avatar joebew42 avatar jonoterc avatar luxflux avatar mczepiel avatar omarqureshi avatar pascalbourdier avatar pbrit avatar pspoerri avatar rnelson0 avatar rubys avatar saz avatar sgp avatar smortex avatar stintel avatar stmontgomery avatar teknotus avatar tmclaugh avatar xelwarto avatar zilchms avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

puppet-rvm's Issues

RVM Fails due to some certificate

I have a Vagrantfile that spins up a VM with RVM as:

  config.vm.provision 'shell' do |shell|
    shell.inline = 
      'touch /var/lib/hiera/common.yaml;' + 
      '[ -d /etc/puppet/modules/rvm ] || sudo puppet module install maestrodev/rvm;'
  end

  config.vm.provision :puppet do |puppet|
    puppet.manifests_path = '.vagrant/manifests'
    puppet.manifest_file = 'default.pp'
  end

Where default.pp is:

package { 'libcurl-devel':
  ensure   => installed,
  provider => yum,
}->

class { 'rvm':
}->

rvm::system_user { 
  vagrant: 
  ; 
}->

rvm_system_ruby {
  '2.1.1':
    ensure      => 'present',
    default_use => true;
}

This code has worked until today it seems, where it errors with:

Notice: /Stage[main]/Rvm::Group/Group[rvm]/ensure: created
Notice: /Stage[main]/Rvm::Rvmrc/File[/etc/rvmrc]/ensure: defined content as '{md5}3ec590d219afbf91a7c1a149a15e72cb'
Notice: /Stage[main]//Package[libcurl-devel]/ensure: created
Notice: /Stage[main]//Service[iptables]/ensure: ensure changed 'running' to 'stopped'
Notice: /Stage[main]/Resolv_conf/File[resolv.conf]/content: content changed '{md5}952b66961b92ab3941df7256d4cb6b40' to '{md5}8f357a2e70da9d6391318d162731b4ca'
Notice: /Stage[main]/Rvm::System/Exec[system-rvm]/returns: bash: line 1: syntax error near unexpected token `newline'
Notice: /Stage[main]/Rvm::System/Exec[system-rvm]/returns: bash: line 1: `<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">'
Error: /usr/bin/curl -sSL https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer |                     bash -s -- --version latest returned 2 instead of one of [0]
Error: /Stage[main]/Rvm::System/Exec[system-rvm]/returns: change from notrun to 0 failed: /usr/bin/curl -sSL https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer |                     bash -s -- --version latest returned 2 instead of one of [0]
Notice: /Stage[main]//Rvm::System_user[vagrant]/Exec[rvm-system-user-vagrant]/returns: executed successfully
Error: Could not find a suitable provider for rvm_system_ruby
Notice: Finished catalog run in 41.78 seconds
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

puppet apply --manifestdir /tmp/vagrant-puppet-1/manifests --detailed-exitcodes /tmp/vagrant-puppet-1/manifests/default.pp || [ $? -eq 2 ]

Stdout from the command:

Notice: /Stage[main]/Rvm::Group/Group[rvm]/ensure: created
Notice: /Stage[main]/Rvm::Rvmrc/File[/etc/rvmrc]/ensure: defined content as '{md5}3ec590d219afbf91a7c1a149a15e72cb'
Notice: /Stage[main]//Package[libcurl-devel]/ensure: created
Notice: /Stage[main]//Service[iptables]/ensure: ensure changed 'running' to 'stopped'
Notice: /Stage[main]/Rvm::System/Exec[system-rvm]/returns: bash: line 1: syntax error near unexpected token `newline'
Notice: /Stage[main]/Rvm::System/Exec[system-rvm]/returns: bash: line 1: `<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">'
Notice: /Stage[main]//Rvm::System_user[vagrant]/Exec[rvm-system-user-vagrant]/returns: executed successfully
Notice: Finished catalog run in 41.78 seconds

and

Error: /usr/bin/curl -sSL https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer |                     bash -s -- --version latest returned 2 instead of one of [0]
Error: /Stage[main]/Rvm::System/Exec[system-rvm]/returns: change from notrun to 0 failed: /usr/bin/curl -sSL https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer |                     bash -s -- --version latest returned 2 instead of one of [0]
Error: Could not find a suitable provider for rvm_system_ruby

The error seems to be the SSL cert, as going into the box i can get that curl command to work only by adding the insecure flag -k. The teporary fix is to modify my Vagrantfile to look like:

  config.vm.provision 'shell' do |shell|
    shell.inline = 
      'touch /var/lib/hiera/common.yaml;' +
      '[ -d /etc/puppet/modules/rvm ] || sudo puppet module install maestrodev/rvm;' +
      '[ -f /root/.curlrc ] || echo insecure > /root/.curlrc;'
  end

Installation Help

Hey,

I've been trying to install this and get it working with no luck. I keep running into different issues. Do you have better installation documentation? I think I'm running into dependency issues, but I'm not sure how to resolve.

How to: Not use group=rvm

I have restrictions which makes me not able to create users or groups. How would I go about installing rvm under for example group root instead?

`ensure => latest` results in resource change on every run

I have the following in a manifest:

rvm_gem { 'bosh_cli_plugin_micro':
    ensure       => 'latest',
    ruby_version => 'ruby-2.0',
    require      =>  Rvm_system_ruby['ruby-2.0'],
}

gem list on a host currently returns:

...
bosh_cli_plugin_micro (1.2707.0, 1.2697.0, 1.2693.0, 1.2690.0, 1.2686.0, 1.2685.0, 1.2682.0, 1.2671.0, 1.2640.0, 1.2624.0, 1.2619.0, 1.2611.0, 1.2579.0)
...

On every Puppet run, I get the following logged:

Notice: /Stage[main]/.../Rvm_gem[bosh_cli_plugin_micro]/ensure: ensure changed '1.2707.01.2697.01.2693.01.2690.01.2686.01.2685.01.2682.01.2671.01.2640.01.2624.01.2619.01.2611.01.2579.0' to 'latest'

It looks like ensure => latest doesn't correctly realise this is a no-op when the latest version (1.2707.0 presumably) is contained in the concatenated string of versions already installed.

Can anything be done to make this smarter?

RVM installs with default ruby but fails to create gemset

I am running maestrodev-rvm (v1.11.0) with Puppet 3.7.5. The client is running CentOS 6.4.

I've gotten early versions to work by running puppet twice but lately I have been encountering a new failure after the RVM module is run and I try to create gemsets with another module (I was having the same problem with v1.8.2). I have tried running only the rvm module and then adding the gemset module (gems for use with Capistrano), but I end up with this every time:

http://pastebin.com/zPAcJ5vm

I have not changed anything within the module itself. Parameter data is stored in hiera:

http://pastebin.com/egNXwfTN

Finally here is the sole .pp file from the "cap" module I created to install the gemset:

http://pastebin.com/RPeDSUxB

I understand that evaluation order of the catalog can cause issues, but this seems unrelated. Can you shed any light as to what's happening here?

Thanks
--Greg Chavez

Key server down

The default key server displays the default Apache page. Is there an alternative, more reliable key server?

CentOS 7 dependencies should be libcurl-devel not curl-devel

It would seem that the dependencies/centos.pp needs some work for CentOS 7.

[root@cc-devapp-01 ~]# yum search curl-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * centos7-x86_64-base: mirror.keystealth.org
 * centos7-x86_64-epel: mirrors.cat.pdx.edu
 * centos7-x86_64-updates: mirrors.easynews.com
 * epel: mirrors.cat.pdx.edu
=================== N/S matched: curl-devel =============
flickcurl-devel.x86_64 : Development files for flickcurl
libcurl-devel.i686 : Files needed for building applications with libcurl
libcurl-devel.x86_64 : Files needed for building applications with libcurl

We should probably use
$::operatingsystemmajrelease >= 6 ... unless you really want to hard code it for each major release, which I guess are not that often :)

~tommy

Puppet RVM looks for presence of gpg2, but RVM installer is agostic

The RVM install script will check if you have either gpg2 or gpg installed, and use either to validate the GPG signature.

However, currently Puppet RVM only checks for gpg2 (and if it's found install the public key). This could lead to a confusing situation / failed provision if you have gpg installed: the installation will fail because puppet RVM hasn't downloaded the key (no gpg2 in the path!) but RVM's installed script wants to check the validity anyway (because it sees gpg in the path).

While this can be worked around (require the rvm GPG resource before Puppet installs RVM), it was.. rather surprising to see it fail and resulted in a lot of head scratching on my front.

TL; DR: can we check for gpg in addition to gpg2 ? And if either is there use the appropriate one to download the public key?

Can't install Rubinius

tl;dr

install from console โ€” works, install from puppet โ€” no.

tl
** Execute gems:install
/usr/local/rvm/src/rbx-2.2.10/staging/bin/rbx /usr/local/rvm/src/rbx-2.2.10/rakelib/preinstall_gems.rb
Pre-installing gems for 2.1.0...
An exception occurred running /usr/local/rvm/src/rbx-2.2.10/rakelib/preinstall_gems.rb:

    invalid gem: package is corrupt, exception while verifying: invalid byte sequence in US-ASCII (ArgumentError) in /usr/local/rvm/src/rbx-2.2.10/vendor/cache/bundler-1.6.2.gem (Gem::InstallError)

Backtrace:

ESC[0;31m                 Gem::Installer#spec at /usr/local/rvm/src/rbx-2.2.10/staging
                                        /library/rubygems/installer.rb:198ESC[0m
 Gem::Installer#ensure_loadable_spec at /usr/local/rvm/src/rbx-2.2.10/staging
                                        /library/rubygems/installer.rb:528ESC[0m
   Gem::Installer#pre_install_checks at /usr/local/rvm/src/rbx-2.2.10/staging
                                        /library/rubygems/installer.rb:747ESC[0m
              Gem::Installer#install at /usr/local/rvm/src/rbx-2.2.10/staging
                                        /library/rubygems/installer.rb:213ESC[0m
            { } in Object#__script__ at /usr/local/rvm/src/rbx-2.2.10/rakelib
                                        /preinstall_gems.rb:30ESC[0m
ESC[0;34m                           Array#each at kernel/bootstrap/array.rb:76ESC[0m
                   Object#__script__ at /usr/local/rvm/src/rbx-2.2.10/rakelib
                                        /preinstall_gems.rb:24ESC[0m
ESC[0;34m     Rubinius::CodeLoader#load_script at kernel/delta/code_loader.rb:66ESC[0m
ESC[0;34m     Rubinius::CodeLoader.load_script at kernel/delta/code_loader.rb:152ESC[0m
ESC[0;34m              Rubinius::Loader#script at kernel/loader.rb:649ESC[0m
ESC[0;34m                Rubinius::Loader#main at kernel/loader.rb:825ESC[0m
rake aborted!
Command failed with status (1): [/usr/local/rvm/src/rbx-2.2.10/staging/bin/...]

I'm using http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210.box as my base box. Which should have correct locale. Changing locale, however, doesn't fix anything.

vagrant@ubuntu-server-12042-x64-vbox4210:~$ locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8
vagrant@ubuntu-server-12042-x64-vbox4210:~$ sudo locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8

Ruby 2.0.0-p0 CentOS 6 has additional dependencies.

To install 2.0.0-p0 on CentOS 6 the following are also required:

if ! defined(Package['libyaml-devel']) { package { 'libyaml-devel': ensure => installed } }
if ! defined(Package['libffi-devel']) { package { 'libffi-devel': ensure => installed } }
if ! defined(Package['libtool']) { package { 'libtool': ensure => installed } }
if ! defined(Package['bison']) { package { 'bison': ensure => installed } }

It installs successfully once these are added to dependencies/centos.pp

documentation references puppet 2.x, module requires puppet 3

a bit confusing in README.markdown:

System Requirements

Puppet 3.0.0 or higher.

...

Add Puppet Module

In Puppet 2.x enable plugin synchronization for custom types. In your puppet.conf (usually in /etc/puppet) on both the Master and Client ensure you have:

...

instructions to use `file{'/etc/rvmrc'}` fail as duplicate

There's already a File['/etc/rvmrc'] defined in Class['rvm::rvmrc'] such that the instructions in the readme do not work as it would be editing the same file. Is the intention to use class { 'rvm::rvmrc': โ€ฆ } ?

FWIW I ran into this when trying to set the rvm_silence_path_mismatch_check_flag=1 to ignore my path being configured with a relative binpath ahead of rvm in the $PATH

Install Stage breaking entire puppet run due to missing dependencies

When using this on a fresh machine, the install stage ends up breaking the entire puppet run if it can't install any of the dependencies. On CentOS 6, the 'libyaml-devel' package is only available out of the EPEL repos and I'm using the stahnma/puppet-module-epel module to manage the EPEL repo on the machines I'm working with.

Since the rvm-install stage is before main, the package install fails which then blocks the main stage from running and preventing the installation of the EPEL repos on the machine.

Is having the install stage necessary?

Changes for gpg ignore Darwin (OSX) support

The latest changes to class rvm::system ignore Darwin.

GPG is only used by rvm if it it installed on the system. Darwin does not come with gpg, so
exec { 'system-rvm-gpg-key': } will blow up.

I just checked and rvm skips gpg check and proceeds normally on stock OSX.

RVM will skip gpg if not present, so maybe just run this on:
kernel = Linux
make a fact to detect if gpg present
What does everyone prefer?

Furthermore roots home is /var/root on Darwin.

I will start working on some commits...

Installing RVM breaks puppet on target system

After installing RVM and creating a gemset provisioning my Vagrant box won't work anymore for the relatively obvious reason that the new system ruby won't have the puppet gem installed. Simple workaround is to add puppet as a gem to any gemset on the box.

Haven't found anything about this in the docs or FAQ so I'm not sure if this is an issue or not. Given the nature of the problem, I'd expect that to be a pretty common problem. Shouldn't it at least be mentioned in the FAQ or something?

using rvm to different location

Hi maestrodev, just wondering is there a way to

  1. install rvm to different home directory, rather than /usr/local/rvm i would like to install to some other location like /mnt/tools/rvm
  2. install it as different user so that other user like jenkins and leverage it.

The goal is to setup a rvm in our "standard" directory and make sure jenkins user can install whatever ruby or create gemset it needs.

After installing several rubies with bundler for each, bundler is not available when entering project directory

Trying to sort the problem I'm detailing here: http://stackoverflow.com/questions/29520563/why-does-bundler-disapear-after-entering-project-directory-with-puppet-installed

I'm not sure if it is related to my ignorance of something in set up (likely) or a possible bug with this install module. I want to install a few rubies and have bundler installed for each, here is the relevant part of my main.pp:

# Install and Setup RVM
class { 'rvm': }
rvm::system_user { vagrant: ; root: ; }

rvm_system_ruby {
  'ruby-2.0.0':
    ensure      => 'present',
    default_use => false;
  'ruby-2.1.5':
    ensure      => 'present',
    default_use => false;
  'ruby-2.2.1':
    ensure      => 'present',
    default_use => true;
}

rvm_gem {
  'bundler-2.0.0':
    name         => 'bundler',
    ruby_version => 'ruby-2.0.0',
    ensure       => latest,
    require      => Rvm_system_ruby['ruby-2.0.0'];
}

rvm_gem {
  'bundler-2.1.5':
    name         => 'bundler',
    ruby_version => 'ruby-2.1.5',
    ensure       => latest,
    require      => Rvm_system_ruby['ruby-2.1.5'];
}

rvm_gem {
  'bundler-2.2.1':
    name         => 'bundler',
    ruby_version => 'ruby-2.2.1',
    ensure       => latest,
    require      => Rvm_system_ruby['ruby-2.2.1'];
}

when i cd into a project directory that specifies 2.1.5 in the .ruby-version file, bundler is not available.

Please help. Thanks! All the source is here: https://github.com/neverstopbuilding/talon

Set --no-document (--no-ri --no-rdoc) option in rvm_gem if gem installed from local sources

We use puppet-rvm to install rvm, ruby, and some gems from already existing gem files.
One of the gem is a legacy one and has broken documentation. In result, output of gem install gem-with-broken-docs.gem is always erroneous and puppet-rvm fails as soon as it processes this gem. Unfortunately, we cannot fix it and rebuild gem.
Initially I thought, that I can pass parameter like --no-documentation to rvm_gem, but :withopts param appears does not work for such cases.
A quick look at https://github.com/maestrodev/puppet-rvm/blob/maestrodev/lib/puppet/provider/rvm_gem/gem.rb code shows that in install method docs never installed for gem if :source param n/a. But in our case, we use :source param to point out to gem's location.
A simple code modification will solve issue:

if source = resource[:source]
  # ...
  case uri.scheme
  when nil
    # no URI scheme => interpret the source as a local file
    #command << source
    command << '-N' << source # --no-documentation if local file
  when /file/i
    command << uri.path
  when 'puppet'
    # we don't support puppet:// URLs (yet)
    raise Puppet::Error.new("puppet:// URLs are not supported as gem sources")
  else
    # interpret it as a gem repository
    command << "--source" << "#{source}" << resource[:name]
  end
else
  command << "--no-rdoc" << "--no-ri" <<  resource[:name]
end

Also, for consistency, it make sense to disable docs installation for all cases by default.
Another option is to add install/update options param to rvm_gem type.

Rvm install not working due to github domain changes

This command silently fails to download the installer
/usr/bin/curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer -o /tmp/rvm-installer

Looks like curl isn't following the redirect to raw.githubusercontent.com
https://raw.githubusercontent.com/wayneeseguin/rvm/master/binscripts/rvm-installer

rvm no available for user

Hi, rvm is installed in the system but the users are not able to use them, it seems that rvm scripts are not sourced.
This is the message I get:

No command 'rvm' found

This is my configuration:

  include rvm
  rvm::system_user { ubuntu: ; deployer: ;}
    rvm_system_ruby { 'ruby-2.1.3':
    ensure      => 'present',
    default_use => true,
  }   

I am running on Ubuntu 14.04.
Am I doing something wrong? or is just this version is not supported?

ruby-2.0.0 breaks rvm_gem type

ruby 2.0 has depreciated --include-dependencies -- it is now an assumed argument. thus you get errors such as;

err: /Stage[main]/Kites::Ruby/Rvm_gem[ruby-2.0.0-p0/iron_mq]/ensure: change from absent to present failed: Execution of '/usr/local/rvm/bin/rvm ruby-2.0.0-p0 do gem install --include-dependencies --no-rdoc --no-ri iron_mq' returned 1: ERROR:  While executing gem ... (OptionParser::InvalidOption)
    invalid option: --include-dependencies

err: /Stage[main]/Kites::Ruby/Rvm_gem[ruby-2.0.0-p0/json]/ensure: change from absent to present failed: Execution of '/usr/local/rvm/bin/rvm ruby-2.0.0-p0 do gem install --include-dependencies --no-rdoc --no-ri json' returned 1: ERROR:  While executing gem ... (OptionParser::InvalidOption)
    invalid option: --include-dependencies

err: /Stage[main]/Kites::Ruby/Rvm_gem[ruby-2.0.0-p0/threadz]/ensure: change from absent to present failed: Execution of '/usr/local/rvm/bin/rvm ruby-2.0.0-p0 do gem install --include-dependencies --no-rdoc --no-ri threadz' returned 1: ERROR:  While executing gem ... (OptionParser::InvalidOption)
    invalid option: --include-dependencies

Could not autoload rvm_system_ruby

I'm running into this error any time I try to use the module. Even the most basic usage include rvm produces this error.

I have verified my Puppet version is 3 or greater (currently using 3.4.3).

Could not autoload rvm_system_ruby: Could not autoload /tmp/vagrant-puppet-3/modules-0/rvm/lib/puppet/provider/rvm_system_ruby/rvm_system_ruby.rb: undefined method `has_command' for Puppet::Type::Rvm_system_ruby::ProviderRvm:Class at /tmp/vagrant-puppet-3/modules-0/rvm/manifests/init.pp:28 on 

mod_passenger is installed with yum

First off, great module!

However, I ran into a big of a snag when following the instructions on your Puppet module page to install & configure passenger. This is what I declared in my manifest:

  class { 'apache': }
  class { 'rvm::passenger::apache':
      version            => '4.0.37',
      ruby_version       => 'ruby-2.0.0-p451',
      mininstances       => '3',
      maxinstancesperapp => '0',
      maxpoolsize        => '30',
      spawnmethod        => 'smart-lv2',
  }

And below is a snippet of what got executed. The bothersome portion being that mod_passenger is being installed via yum, which conflicts with what we're trying to accomplish. I don't think this is expected behaviour as you end up with multiple passenger*.conf files, which are using different versions of Ruby and passenger.

Notice: /Stage[main]/Rvm::Passenger::Apache/Exec[passenger-install-apache2-module]/returns: executed successfully
Debug: /Stage[main]/Rvm::Passenger::Apache/Exec[passenger-install-apache2-module]: The container Class[Rvm::Passenger::Apache] will propagate my refresh event
Info: /Stage[main]/Rvm::Passenger::Apache/Exec[passenger-install-apache2-module]: Scheduling refresh of Class[Apache::Mod::Passenger]
Debug: Class[Rvm::Passenger::Apache]: The container Stage[main] will propagate my refresh event
Info: Class[Apache::Mod::Passenger]: Scheduling refresh of Apache::Mod[passenger]
Notice: /Stage[main]/Apache::Mod::Passenger/File[passenger.conf]/ensure: defined content as '{md5}d01efdf35bf619084012f899918b6572'
Info: /Stage[main]/Apache::Mod::Passenger/File[passenger.conf]: Scheduling refresh of Service[httpd]
Debug: /Stage[main]/Apache::Mod::Passenger/File[passenger.conf]: The container Class[Apache::Mod::Passenger] will propagate my refresh event
Debug: Executing '/bin/rpm -q mod_passenger --nosignature --nodigest --qf %{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH}\n'
Debug: Package[mod_passenger](provider=yum): Ensuring => present
Debug: Executing '/usr/bin/yum -d 0 -e 0 -y install mod_passenger'
Debug: Executing '/bin/rpm -q mod_passenger --nosignature --nodigest --qf %{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH}\n'
Notice: /Stage[main]/Apache::Mod::Passenger/Apache::Mod[passenger]/Package[mod_passenger]/ensure: created
Debug: /Stage[main]/Apache::Mod::Passenger/Apache::Mod[passenger]/Package[mod_passenger]: The container Apache::Mod[passenger] will propagate my refresh event

I tracked where this package resource was being declared, and it appears to come from the puppetlabs-apache module. Specifically from within the manifests/mod/passenger.pp file:

  if $::osfamily == 'FreeBSD' {
    ::apache::mod { 'passenger':
      lib_path => "${passenger_root}/buildout/apache2"
    }
  } else {
    # Problem line here
    ::apache::mod { 'passenger': }
  }

::apache::mod is a define type that automatically installs the mod_passenger package (original file: manifests/mod.pp). I know there's not much you can do about this, as it's not your module's fault, but I thought I would make the issue aware for other people trying to use your module to deploy passenger.

RVM version change fails due to recent commit

I blame this commit: 83e79c6
The resource type was changed from a notify to a notice which means the require found here is now referencing an non-existent resource.

I have removed that require line and the upgrade works properly now, but I don't know what else that might break.

encountering general issues related to running puppet as root

Hi, I'm seeing regular issues related to running puppet as root- these are generally ownership issues where rvm commands affected puppet-rvm-nstalled elements fail when run under a non-privileged user account (due insufficient permissions).

Just to pick the latest issue I'm seeing, a puppet-rvm-installed ruby's rubygems can't be easily updated or turned off via "rvm rubygems VERSION" - an ugly workaround of "rvmsudo rvm ruby gems VERSION" works instead, but only by granting the user sudoer privileges.

I can reference other issues, but before I take up anyone's time, this seems like a potentially icky enough problem that I rather assume I'm somehow approaching this the wrong way? For example, is this module only intended for being run under a non-privileged puppet run, or is there a way to configure puppet so that just the puppet-rvm's actions are run non-privileged?

Thanks!

passenger_mod.so missing?

I am having an issue with install-passenger-apache2-module on vagrant box. Logs says that this stup executed successfully, however there is no buildout folder in passenger gem path and apache fails to start due to missing passenger_mod.so file. I'm sorry if I missed sth obvious but I am just starting puppet and I am trying to figure it out for couple of days already.

Vagrantfile:

 # -*- mode: ruby -*-
 # vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"

 Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

   config.vm.box = "ubuntu14.04"
   config.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box"
   config.vm.define 'backend' do |backend|
     backend.vm.provider :virtualbox do |v|
       v.memory = 2048
     end
     backend.vm.provision :puppet do |puppet|
       puppet.manifest_file  = "backend.pp"
       puppet.module_path = "../puppet/modules"
       puppet.options = "--verbose --debug"
     end
  end
end

Manifest:

 include rvm

 stage {'init':
   before => Stage['main'],
 }

 class {'apt': 
   always_apt_update => true,
   stage  => 'init',
 }

 rvm_system_ruby {
   'ruby-2.1.1':
     ensure      => present,
     default_use => true,
 }

 rvm_gemset {
   'ruby-2.1.1@myapp':
     ensure => present,
     require => Rvm_system_ruby['ruby-2.1.1']
 }

 rvm_gem {
   'ruby-2.1.1@myapp/bundler':
     ensure => present,
     require => Rvm_gemset['ruby-2.1.1@myapp'],
 }

 class { 'apache': }
 class { 'rvm::passenger::apache':
     version            => '4.0.48',
     ruby_version       => 'ruby-2.1.1',
    mininstances       => '3',
     maxinstancesperapp => '0',
     maxpoolsize        => '30',
     spawnmethod        => 'smart-lv2',
 }

Log file (without --debug --verbose for simplicity):

 Bringing machine 'backend' up with 'virtualbox' provider...
 ==> backend: Importing base box 'ubuntu14.04'...

 ๏ฟฝ[KProgress: 90%
 ๏ฟฝ[K==> backend: Matching MAC address for NAT networking...
 ==> backend: Setting the name of the VM: Backend_backend_1408140661365_20892
 ==> backend: Clearing any previously set forwarded ports...
 ==> backend: Clearing any previously set network interfaces...
 ==> backend: Preparing network interfaces based on configuration...
     backend: Adapter 1: nat
 ==> backend: Forwarding ports...
     backend: 22 => 2222 (adapter 1)
 ==> backend: Running 'pre-boot' VM customizations...
 ==> backend: Booting VM...
 ==> backend: Waiting for machine to boot. This may take a few minutes...
     backend: SSH address: 127.0.0.1:2222
     backend: SSH username: vagrant
     backend: SSH auth method: private key
     backend: Warning: Connection timeout. Retrying...
     backend: Warning: Remote connection disconnect. Retrying...
 ==> backend: Machine booted and ready!
 GuestAdditions 4.3.10 running --- OK.
 ==> backend: Checking for guest additions in VM...
 ==> backend: Mounting shared folders...
     backend: /vagrant => /home/broisatse/Work/BeeOrganised/Backend
     backend: /tmp/vagrant-puppet-2/manifests => /home/broisatse/Work/BeeOrganised/Backend/manifests
     backend: /tmp/vagrant-puppet-2/modules-0 => /home/broisatse/Work/BeeOrganised/puppet/modules
 ==> backend: Running provisioner: puppet...
 ==> backend: Running Puppet with backend.pp...
 ==> backend: stdin: is not a tty
 ==> backend: Warning: Config file /etc/puppet/hiera.yaml not found, using Hiera defaults
 ==> backend: Notice: Compiled catalog for vagrant-ubuntu-trusty-64.mynet in environment production in 2.60 seconds
 ==> backend: Notice: /Stage[init]/Apt::Update/Exec[apt_update]/returns: executed successfully
 ==> backend: Notice: /Stage[main]/Concat::Setup/File[/var/lib/puppet/concat]/ensure: created
 ==> backend: Notice: /Stage[main]/Concat::Setup/File[/var/lib/puppet/concat/bin]/ensure: created
 ==> backend: Notice: /Stage[main]/Concat::Setup/File[/var/lib/puppet/concat/bin/concatfragments.sh]/ensure: defined content as '{md5}7bbe7c5fce25a5ddd20415d909ba44fc'
 ==> backend: Notice: /Stage[main]/Rvm::Group/Group[rvm]/ensure: created
 ==> backend: Notice: /Stage[main]/Rvm::Rvmrc/File[/etc/rvmrc]/ensure: defined content as '{md5}3ec590d219afbf91a7c1a149a15e72cb'
 ==> backend: Notice: /Stage[main]/Rvm::Passenger::Dependencies::Ubuntu/Package[libcurl4-gnutls-dev]/ensure: ensure changed 'purged' to 'present'
 ==> backend: Notice: /Stage[main]/Apache/Package[httpd]/ensure: ensure changed 'purged' to 'present'
 ==> backend: Notice: /Stage[main]/Apache/Exec[mkdir /etc/apache2/conf.d]/returns: executed successfully
 ==> backend: Notice: /Stage[main]/Apache/File[/etc/apache2/apache2.conf]/content: content changed '{md5}da32fcc6a783acaebf0d74c17c726bf7' to '{md5}9e1ef21e638936a330d4a4ce36582d14'
 ==> backend: Notice: /Stage[main]/Apache::Dev/Package[libapr1-dev]/ensure: ensure changed 'purged' to 'present'
 ==> backend: Notice: /Stage[main]/Apache/File[/etc/apache2/sites-enabled/000-default.conf]/ensure: removed
 ==> backend: Notice: /Stage[main]/Apache::Dev/Package[apache2-prefork-dev]/ensure: ensure changed 'purged' to 'present'
 ==> backend: Notice: /Stage[main]/Apache::Mod::Mime/Apache::Mod[mime]/File[mime.load symlink]/target: target changed '../mods-available/mime.load' to '/etc/apache2/mods-available/mime.load'
 ==> backend: Notice: /Stage[main]/Apache::Default_mods/Apache::Mod[authz_groupfile]/File[authz_groupfile.load]/content: content changed '{md5}97a3e14926ce7bf5f2d2a7b93ece648d' to '{md5}bf972e82336c72b20d67d871ef77d4ce'
 ==> backend: Notice: /Stage[main]/Apache::Default_mods/Apache::Mod[authz_groupfile]/File[authz_groupfile.load symlink]/ensure: created
 ==> backend: Notice: /Stage[main]/Apache::Default_mods/Apache::Mod[authz_user]/File[authz_user.load]/content: content changed '{md5}bcf988f105564ec1e14b78df56a01cd8' to '{md5}69150f8246499e0135580d8cc16eaeab'
 ==> backend: Notice: /Stage[main]/Apache::Mod::Mime/File[mime.conf]/content: content changed '{md5}7369c2fd5edf2192edbd6d865b632ae5' to '{md5}2fa646fe615e44d137a5d629f868c107'
 ==> backend: Notice: /Stage[main]/Apache::Default_mods/Apache::Mod[access_compat]/File[access_compat.load]/content: content changed '{md5}f7f77b3eb4005749b583ff14b49f8bf1' to '{md5}a3e92887d86700b30a3869d0e8c159d7'
 ==> backend: Notice: /Stage[main]/Apache::Default_mods/Apache::Mod[access_compat]/File[access_compat.load symlink]/target: target changed '../mods-available/access_compat.load' to '/etc/apache2/mods-available/access_compat.load'
 ==> backend: Notice: /Stage[main]/Apache::Mod::Setenvif/File[setenvif.conf]/content: content changed '{md5}533f5f92761c2c24d6820f1d7d1c45ad' to '{md5}c7ede4173da1915b7ec088201f030c28'
 ==> backend: Notice: /Stage[main]/Apache::Mod::Deflate/File[deflate.conf]/content: content changed '{md5}6649a32153b9afdc53f6898b5a10a2d6' to '{md5}44d54f557a5612be8da04c49dd6da862'
 ==> backend: Notice: /Stage[main]/Apache::Mod::Negotiation/File[negotiation.conf]/content: content changed '{md5}443398efdd41085bc1a70047f6e61c95' to '{md5}47284b5580b986a6ba32580b6ffb9fd7'
 ==> backend: Notice: /Stage[main]/Apache::Mod::Negotiation/Apache::Mod[negotiation]/File[negotiation.conf symlink]/target: target changed '../mods-available/negotiation.conf' to '/etc/apache2/mods-available/negotiation.conf'
 ==> backend: Notice: /Stage[main]/Apache::Mod::Alias/Apache::Mod[alias]/File[alias.load symlink]/target: target changed '../mods-available/alias.load' to '/etc/apache2/mods-available/alias.load'
 ==> backend: Notice: /Stage[main]/Apache::Mod::Dir/File[dir.conf]/content: content changed '{md5}fe4bc5fa3b3cc7a241fe57f8fabc55a1' to '{md5}c741d8ea840e6eb999d739eed47c69d7'
 ==> backend: Notice: /Stage[main]/Apache::Mod::Dir/Apache::Mod[dir]/File[dir.conf symlink]/target: target changed '../mods-available/dir.conf' to '/etc/apache2/mods-available/dir.conf'
 ==> backend: Notice: /Stage[main]/Apache::Mod::Setenvif/Apache::Mod[setenvif]/File[setenvif.load symlink]/target: target changed '../mods-available/setenvif.load' to '/etc/apache2/mods-available/setenvif.load'
 ==> backend: Notice: /Stage[main]/Apache::Default_mods/Apache::Mod[auth_basic]/File[auth_basic.load]/content: content changed '{md5}a92c34a3ce5e67e2ecbd272155ebe072' to '{md5}5eec35bb52e1ae9ff5eec602ed1d2374'
 ==> backend: Notice: /Stage[main]/Apache::Default_mods/Apache::Mod[auth_basic]/File[auth_basic.load symlink]/target: target changed '../mods-available/auth_basic.load' to '/etc/apache2/mods-available/auth_basic.load'
 ==> backend: Notice: /Stage[main]/Apache/Concat[/etc/apache2/ports.conf]/File[/var/lib/puppet/concat/_etc_apache2_ports.conf]/ensure: created
 ==> backend: Notice: /Stage[main]/Apache/Concat[/etc/apache2/ports.conf]/File[/var/lib/puppet/concat/_etc_apache2_ports.conf/fragments.concat.out]/ensure: created
 ==> backend: Notice: /Stage[main]/Apache::Default_mods/Apache::Mod[authn_file]/File[authn_file.load symlink]/target: target changed '../mods-available/authn_file.load' to '/etc/apache2/mods-available/authn_file.load'
 ==> backend: Notice: /Stage[main]/Apache::Mod::Dav/Apache::Mod[dav]/File[dav.load symlink]/ensure: created
 ==> backend: Notice: /Stage[main]/Apache/Concat[/etc/apache2/ports.conf]/File[/var/lib/puppet/concat/_etc_apache2_ports.conf/fragments.concat]/ensure: created
 ==> backend: Notice: /Stage[main]/Apache::Mod::Dir/Apache::Mod[dir]/File[dir.load symlink]/target: target changed '../mods-available/dir.load' to '/etc/apache2/mods-available/dir.load'
 ==> backend: Notice: /Stage[main]/Apache::Mod::Mime/Apache::Mod[mime]/File[mime.conf symlink]/target: target changed '../mods-available/mime.conf' to '/etc/apache2/mods-available/mime.conf'
 ==> backend: Notice: /Stage[main]/Apache::Mod::Dav_fs/Apache::Mod[dav_fs]/File[dav_fs.load]/content: content changed '{md5}17f662fd023dbaaab9d89f9a11ae58c1' to '{md5}3fa14d6e9f9d8eb25d09ed4823508f6d'
 ==> backend: Notice: /Stage[main]/Apache::Mod::Dav_fs/Apache::Mod[dav_fs]/File[dav_fs.load symlink]/ensure: created
 ==> backend: Notice: /Stage[main]/Apache::Mod::Alias/File[alias.conf]/content: content changed '{md5}c6e9f26152898c38e58211c8b362d5c3' to '{md5}cb528041df274fb077800a8e2e64f94e'
 ==> backend: Notice: /Stage[main]/Apache::Mod::Alias/Apache::Mod[alias]/File[alias.conf symlink]/target: target changed '../mods-available/alias.conf' to '/etc/apache2/mods-available/alias.conf'
 ==> backend: Notice: /Stage[main]/Apache::Default_mods/Apache::Mod[authz_core]/File[authz_core.load symlink]/target: target changed '../mods-available/authz_core.load' to '/etc/apache2/mods-available/authz_core.load'
 ==> backend: Notice: /Stage[main]/Apache::Mod::Negotiation/Apache::Mod[negotiation]/File[negotiation.load symlink]/target: target changed '../mods-available/negotiation.load' to '/etc/apache2/mods-available/negotiation.load'
 ==> backend: Notice: /Stage[main]/Apache/Concat[/etc/apache2/ports.conf]/File[/var/lib/puppet/concat/_etc_apache2_ports.conf/fragments]/ensure: created
 ==> backend: Notice: /Stage[main]/Apache/Apache::Vhost[default]/Apache::Listen[80]/Concat::Fragment[Listen 80]/File[/var/lib/puppet/concat/_etc_apache2_ports.conf/fragments/10_Listen 80]/ensure: defined content as '{md5}d5fcefc335117f400d451de47efeca87'
 ==> backend: Notice: /Stage[main]/Apache::Mod::Reqtimeout/File[reqtimeout.conf]/content: content changed '{md5}40b45155afb3d14263d12e6fc4a98513' to '{md5}81c51851ab7ee7942bef389dc7c0e985'
 ==> backend: Notice: /Stage[main]/Apache::Mod::Reqtimeout/Apache::Mod[reqtimeout]/File[reqtimeout.conf symlink]/ensure: created
 ==> backend: Notice: /Stage[main]/Apache::Mod::Reqtimeout/Apache::Mod[reqtimeout]/File[reqtimeout.load symlink]/ensure: created
 ==> backend: Notice: /Stage[main]/Apache/File[/etc/apache2/sites-available/default-ssl.conf]/ensure: removed
 ==> backend: Notice: /Stage[main]/Apache::Mod::Setenvif/Apache::Mod[setenvif]/File[setenvif.conf symlink]/target: target changed '../mods-available/setenvif.conf' to '/etc/apache2/mods-available/setenvif.conf'
 ==> backend: Notice: /Stage[main]/Apache::Mod::Deflate/Apache::Mod[deflate]/File[deflate.conf symlink]/target: target changed '../mods-available/deflate.conf' to '/etc/apache2/mods-available/deflate.conf'
 ==> backend: Notice: /Stage[main]/Apache::Mod::Deflate/Apache::Mod[deflate]/File[deflate.load]/content: content changed '{md5}6a7a23153796456ee919abdf728fd972' to '{md5}ac4540dd672556b07f900425751f745c'
 ==> backend: Notice: /Stage[main]/Apache::Mod::Deflate/Apache::Mod[deflate]/File[deflate.load symlink]/target: target changed '../mods-available/deflate.load' to '/etc/apache2/mods-available/deflate.load'
 ==> backend: Notice: /Stage[main]/Apache::Mod::Autoindex/Apache::Mod[autoindex]/File[autoindex.load symlink]/target: target changed '../mods-available/autoindex.load' to '/etc/apache2/mods-available/autoindex.load'
 ==> backend: Notice: /Stage[main]/Apache::Mod::Autoindex/File[autoindex.conf]/content: content changed '{md5}bfba7d77669e02b869b92e98215d58fc' to '{md5}2421a3c6df32c7e38c2a7a22afdf5728'
 ==> backend: Notice: /Stage[main]/Apache::Mod::Autoindex/Apache::Mod[autoindex]/File[autoindex.conf symlink]/target: target changed '../mods-available/autoindex.conf' to '/etc/apache2/mods-available/autoindex.conf'
 ==> backend: Notice: /Stage[main]/Apache/Concat::Fragment[Apache ports header]/File[/var/lib/puppet/concat/_etc_apache2_ports.conf/fragments/10_Apache ports header]/ensure: defined content as '{md5}afe35cb5747574b700ebaa0f0b3a626e'
 ==> backend: Notice: /Stage[main]/Apache/Concat[/etc/apache2/ports.conf]/Exec[concat_/etc/apache2/ports.conf]/returns: executed successfully
 ==> backend: Notice: /Stage[main]/Apache/Concat[/etc/apache2/ports.conf]/Exec[concat_/etc/apache2/ports.conf]: Triggered 'refresh' from 4 events
 ==> backend: Notice: /Stage[main]/Apache/Concat[/etc/apache2/ports.conf]/File[/etc/apache2/ports.conf]/content: content changed '{md5}a961f23471d985c2b819b652b7f64321' to '{md5}334fa5cddbf9a408ea1ca7a1666b1fc4'
 ==> backend: Notice: /Stage[main]/Apache::Default_mods/Apache::Mod[authz_host]/File[authz_host.load]/content: content changed '{md5}f529587409471e3feb62256bccaf538a' to '{md5}4b8162e3e3a58d1dc2222e2ad352bd93'
 ==> backend: Notice: /Stage[main]/Apache::Default_mods/Apache::Mod[authz_host]/File[authz_host.load symlink]/target: target changed '../mods-available/authz_host.load' to '/etc/apache2/mods-available/authz_host.load'
 ==> backend: Notice: /Stage[main]/Apache::Default_mods/Apache::Mod[filter]/File[filter.load symlink]/target: target changed '../mods-available/filter.load' to '/etc/apache2/mods-available/filter.load'
 ==> backend: Notice: /Stage[main]/Apache::Mod::Worker/Apache::Mpm[worker]/File[/etc/apache2/mods-available/worker.load]/ensure: defined content as '{md5}3064ef75f030fbf76986f6f073beb113'
 ==> backend: Notice: /Stage[main]/Apache::Mod::Worker/Apache::Mpm[worker]/File[/etc/apache2/mods-enabled/worker.load]/ensure: created
 ==> backend: Notice: /Stage[main]/Apache::Mod::Worker/File[/etc/apache2/mods-available/worker.conf]/ensure: defined content as '{md5}8b152143a27f5bf9aafdcd81059ea91c'
 ==> backend: Notice: /Stage[main]/Apache::Mod::Worker/Apache::Mpm[worker]/File[/etc/apache2/mods-enabled/worker.conf]/ensure: created
 ==> backend: Notice: /Stage[main]/Apache::Mod::Cgid/File[cgid.conf]/content: content changed '{md5}e8a2836392051bde889cf9c137058273' to '{md5}7dffbb5823bcbb9ab4d3e67ab14d38a0'
 ==> backend: Notice: /Stage[main]/Apache::Mod::Cgid/Apache::Mod[cgid]/File[cgid.conf symlink]/ensure: created
 ==> backend: Notice: /Stage[main]/Apache::Mod::Cgid/Apache::Mod[cgid]/File[cgid.load symlink]/ensure: created
 ==> backend: Notice: /Stage[main]/Rvm::System/Exec[system-rvm]/returns: executed successfully
 ==> backend: Notice: /Stage[main]/Apache::Default_mods/Apache::Mod[env]/File[env.load symlink]/target: target changed '../mods-available/env.load' to '/etc/apache2/mods-available/env.load'
 ==> backend: Notice: /Stage[main]/Apache/File[/etc/apache2/sites-available/000-default.conf]/ensure: removed
 ==> backend: Notice: /Stage[main]/Apache/Apache::Vhost[default]/File[15-default.conf]/ensure: created
 ==> backend: Notice: /Stage[main]/Apache/Apache::Vhost[default]/File[15-default.conf symlink]/ensure: created
 ==> backend: Notice: /Stage[main]/Apache::Mod::Dav_fs/File[dav_fs.conf]/content: content changed '{md5}162db96239f13b5416f369b6306d9db6' to '{md5}e36e2951cff0d4df331652ca6fccdb77'
 ==> backend: Notice: /Stage[main]/Apache::Mod::Dav_fs/Apache::Mod[dav_fs]/File[dav_fs.conf symlink]/ensure: created
 ==> backend: Notice: /Stage[main]/Apache::Default_mods/Apache::Mod[authz_user]/File[authz_user.load symlink]/target: target changed '../mods-available/authz_user.load' to '/etc/apache2/mods-available/authz_user.load'
 ==> backend: Notice: /Stage[main]/Main/Rvm_system_ruby[ruby-2.1.1]/ensure: created
 ==> backend: Notice: /Stage[main]/Rvm::Passenger::Gem/Rvm_gem[passenger]/ensure: created
 ==> backend: Notice: /Stage[main]/Rvm::Passenger::Apache/Exec[passenger-install-apache2-module]/returns: executed successfully
 ==> backend: Notice: /Stage[main]/Apache::Mod::Passenger/File[passenger.conf]/ensure: defined content as '{md5}3655800b46fe71316ec3afbff6f3cd7a'
 ==> backend: Notice: /Stage[main]/Main/Rvm_gemset[ruby-2.1.1@bee_organised]/ensure: created
 ==> backend: Notice: /Stage[main]/Apache::Mod::Passenger/Apache::Mod[passenger]/Package[libapache2-mod-passenger]/ensure: ensure changed 'purged' to 'present'
 ==> backend: Notice: /Stage[main]/Apache::Mod::Passenger/Apache::Mod[passenger]/File[passenger.load]/content: content changed '{md5}61421ba3247d368cfe99b540ad4ebc98' to '{md5}0832bae2588468ab7570b34ed77ef075'
 ==> backend: Notice: /Stage[main]/Apache::Mod::Passenger/Apache::Mod[passenger]/File[passenger.load symlink]/target: target changed '../mods-available/passenger.load' to '/etc/apache2/mods-available/passenger.load'
 ==> backend: Notice: /Stage[main]/Apache::Mod::Passenger/Apache::Mod[passenger]/File[passenger.conf symlink]/target: target changed '../mods-available/passenger.conf' to '/etc/apache2/mods-available/passenger.conf'
 ==> backend: Notice: /Stage[main]/Apache/File[/etc/apache2/mods-enabled/mpm_event.conf]/ensure: removed
 ==> backend: Notice: /Stage[main]/Apache/File[/etc/apache2/mods-enabled/authn_core.load]/ensure: removed
 ==> backend: Notice: /Stage[main]/Apache/File[/etc/apache2/mods-enabled/status.load]/ensure: removed
 ==> backend: Notice: /Stage[main]/Apache/File[/etc/apache2/mods-enabled/status.conf]/ensure: removed
 ==> backend: Notice: /Stage[main]/Apache/File[/etc/apache2/mods-enabled/mpm_event.load]/ensure: removed
 ==> backend: Notice: /Stage[main]/Rvm::Passenger::Apache/Exec[copy passenger_extra.conf to passenger.conf]/returns: executed successfully
 ==> backend: Error: /Stage[main]/Apache::Service/Service[httpd]: Failed to call refresh: Could not start Service[httpd]: Execution of '/etc/init.d/apache2 start' returned 1: 
 ==> backend: Error: /Stage[main]/Apache::Service/Service[httpd]: Could not start Service[httpd]: Execution of '/etc/init.d/apache2 start' returned 1: 
 ==> backend: Notice: Finished catalog run in 601.50 seconds

Push 1.7.0 to Forge

1.7.0 resolves #65, which a few of us need, and was tagged, but is not pushed to the forge.

rvm::passenger::apache not loading correct mod_passenger.so module on Debian

Basically, lib_path needs to be modified in apache::mod::passenger. That module has logic to do the right thing on FreeBSD:

if $::osfamily == 'FreeBSD' {
apache::mod { 'passenger':
lib_path => "${passenger_root}/buildout/apache2"
}
} else {
apache::mod { 'passenger': }
}

but for all other types of systems, lib_path is left alone. That's all good and well if you don't rebuild passenger via rvm::passenger::apache. But if you do (by specifying a $version), you really want to have lib_path set as in the FreeBSD case so that the

mods-available/passenger.load

file ends up pointing at the new mod_passenger.so file.

I'm not sure how to fix that from

rvm/manifests/passenger/apache.pp

Can that be done?

run gem installed with rvm_gem?

I have this code to install a gem I copied in /tmp/mailcatcher.gem

rvm_gem { 'mailcatcher':
    name            => 'mailcatcher',
    source          => '/tmp/mailcatcher.gem',
    ruby_version    => 'ruby-1.9.3-p547',
    ensure          => latest,
    require         => [
        File['/tmp/mailcatcher.gem'], 
        Rvm_system_ruby['ruby-1.9.3-p547']
    ],
}

How can i run the installed gem script afterwards?

If i do this, it fails with "could not find command mailcatcher":

exec { 'start mailcatcher':
    command         => "mailcatcher --http-ip=0.0.0.0",
    require         => Rvm_gem['mailcatcher'],
}

I need something to refresh the env variables, or something to get the new installed gem path.

EDIT: I could hardcode the new path, like /usr/local/rvm/ruby-1.9.3-p547/bin/ but there must be a better way

Invalid resource type rvm_wrapper

This is my manifest rvm.pp

class thirdpillar::rvm(
$ruby_version = 'ruby-1.9.3-p547',
$gemset_name = 'ruby-1.9.3-p547@melbourne',
$wrapper_name = "melbourne",
) {

if $::osfamily == 'RedHat' {
  class { 'epel':
  before => Class['rvm'],
  }
}
else{
    class { 'rvm': }
}

rvm_system_ruby {
  "${ruby_version}":
  ensure      => 'present',
  default_use => true,
}

rvm_gemset {
  "${gemset_name}":
  ensure  => present,
  require => Rvm_system_ruby["${ruby_version}"],
}

rvm_wrapper {
  "${wrapper_name}":
   target_ruby => "${ruby_version}",
   prefix      => 'bootup',
   ensure      => present,
   require     => Rvm_system_ruby["${ruby_version}"],
}

rvm_alias {
  "${wrapper_name}":
   target_ruby => "${ruby_version}",
   ensure      => present,
   require     => Rvm_system_ruby["${ruby_version}"],
}

}

Error: Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid resource type rvm_wrapper at /etc/puppetlabs/puppet/modules/thirdpillar/manifests/rvm.pp:33 on node learn.localdomain

It is recognizing all other resource type like rvm_system_ruby, rvm_gemset, rvm_alias but could not able to recognize rvm_wrapper

Puppet + puppet-rvm + bundler defaults to system Ruby, not RVM default

I'm running a CentOS 6.5 VM with Puppet + puppet-rvm. System Ruby is 1.8.7, but I'm using 1.9.3p545 (RVM default) via the module. On the Puppet master:

class project (
  # Hiera magicks
) {
  include rvm

  rvm_system_ruby {
    'ruby-1.9.3-p545':
      ensure      => present,
      default_use => true,
  } ->
  exec { 'load RVM as a function':
    user    => root,
    cwd     => '/usr/local/rvm',
    command => '/bin/sh -c "source scripts/rvm"',
  } ->
  exec { 'check Ruby version':
    user      => root,
    command   => '/bin/echo "$RUBY_VERSION"',
    logoutput => true,
  } ->
  exec { 'install Ruby dependencies':
    user      => root,
    path      => '/path/to/bundler',
    cwd       => '/my/ruby/project',
    command   => 'bundle install',
    logoutput => true,
  }
}

When I run puppet agent -t on the agent, I get the following error:

Notice: /Stage[main]/Project/Exec[load RVM as a function]/returns: executed successfully
Notice: /Stage[main]/Project/Exec[check Ruby version]/returns: ruby-1.9.3-p545
Notice: /Stage[main]/Project/Exec[check Ruby version]/returns: executed successfully
Notice: /Stage[main]/Project/Exec[install Ruby dependencies]/returns: Your Ruby version is 1.8.7, but your Gemfile specified 1.9.3
Error: bundle install returned 18 instead of one of [0]
Error: /Stage[main]/Project/Exec[install Ruby dependencies]/returns: change from notrun to 0 failed: bundle install returned 18 instead of one of [0]

I checked the Bundler source, and error code 18 is associated with the version mismatch. I haven't been able to figure out why Puppet reports using 1.9.3 via RVM, but then defaults to the system 1.8.7. Any ideas?

Ignores downgrading, and ensure value 'latest'

rvm_gem {
    'passenger-enterprise':
        name         => 'passenger-enterprise-server',
        ruby_version => 'ruby-2.1.0',
        ensure       => latest,
        source      => 'https://www.phusionpassenger.com/enterprise_gems/',
        require      => Rvm_system_ruby['ruby-2.1.0'];
}

Results in:

Error: Could not get latest version: undefined method `[]' for nil:NilClass
Error: /Stage[third]/Passenger/Rvm_gem[passenger-enterprise]/ensure: change from 4.0.374.0.26 to latest failed: Could not get latest version: undefined method `[]' for nil:NilClass
Error: Could not get latest version: undefined method `[]' for nil:NilClass
Error: /Stage[third]/Passenger/Rvm_gem[passenger-enterprise]/ensure: change from 4.0.374.0.26 to latest failed: Could not get latest version: undefined method `[]' for nil:NilClass
Notice: /Stage[main]/Main/Filebucket[main]: Dependency Rvm_gem[passenger-enterprise] has failures: true
Warning: /Stage[main]/Main/Filebucket[main]: Skipping because of failed dependencies

This is when I change from ensure => 'version' to ensure => 'latest' when there are multiple versions installed.

When downgrading from a specific version, Puppet does not remove the newer version. The module makes it impossible to remove one version, but add another (since versions are defined through 'ensure' var).

Bad curl URL for rvm-installer

The curl on the rvm-installer is failing since github moved the raw URL to raw.githubusercontent.com. Curl is not following the redirect and so the module fails.

But, given that get.rvm.io has updated its redirect to the correct URL, and given that the old raw.github.com is not hardcoded into the module; I cannot find where this URL is being discovered.

Info: Applying configuration version 'heads/production-0-g5c17ba6'
Notice: /Stage[main]/Rvm::System/Exec[system-rvm]/returns: bash: line 1: syntax error near unexpected token `newline'
Notice: /Stage[main]/Rvm::System/Exec[system-rvm]/returns: bash: line 1: `<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">'
Error: /usr/bin/curl -sSL https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer |                     bash -s -- --version latest returned 2 instead of one of [0]
Error: /Stage[main]/Rvm::System/Exec[system-rvm]/returns: change from notrun to 0 failed: /usr/bin/curl -sSL https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer |                     bash -s -- --version latest returned 2 instead of one of [0]



curl -IL https://get.rvm.io
HTTP/1.1 301 Moved Permanently
Server: nginx/1.6.0
Date: Fri, 20 Jun 2014 08:44:55 GMT
Content-Type: text/html
Content-Length: 184
Connection: keep-alive
Location: https://raw.githubusercontent.com/wayneeseguin/rvm/master/binscripts/rvm-installer

Concat() requires an array - but it has one

I receive this error message in my production branch, which uses v1.8.0 of maestrodev/rvm and v1.1.2 of puppetlabs-concat:

puppet agent -t

...
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: concat(): Requires array to work with at /etc/puppet/environments/production/modules/rvm/manifests/system.pp:36 on node HOSTNAME

The lines in question are https://github.com/maestrodev/puppet-rvm/blob/maestrodev/manifests/system.pp#L27-L36, and I find it odd that L35 does not complain and, best I can tell, feeds its result, an array, into L36, but L36 generates the error. I really don't get the error message. And here's the profile class; hiera provides no parameter overrides to rvm:

class profile::rvm {
  include '::rvm'

  $ruby_version = 'ruby-1.9.3-p551'
  rvm_system_ruby { $ruby_version:
    ensure      => present,
    default_use => true,
  }

  $rvm_gems = [
    'rspec-puppet',
    'puppet',
    'fpm',
    'puppet-lint',
    'puppetlabs_spec_helper',
  ]
  rvm_gem { $rvm_gems:
    ensure       => latest,
    ruby_version => $ruby_version,
    require      => Rvm_system_ruby[$ruby_version],
  }
}

I do not receive this error on a new branch that has rvm v1.8.0 and concat v1.1.2. I don't know the entirety of the differences in concat v1.1.0 and v1.1.2. I'm not sure that's what causes this issue though, as I could swear (without evidence, of course, cause I didn't think I'd need to capture it at the time) that last month when I built this node everything worked fine. Clearly, it doesn't work now.

Error: Could not autoload json_backend

I am creating a vagrant box for my coworkers. our live server is on centos 6.5 so I am using the puppet box for centos 6.5.

RVM was working for me until I decided to use hiera to configure some settings. I am not using it to configure rvm. Ever since switching I get an error whenever I try to provision the box a second time.

The exact error is Error: Could not autoload /puppet/pops/binder/hiera2/json_backend: no such file to load -- json

I looked this up online and read that it is caused because there is no json gem installed.

I added a shell provision to my vagrant file to install the json gem before the puppet provisioner runs. config.vm.provision "shell", inline: "gem install json"

Now I get a different kind of error. /usr/local/rvm/gems/ruby-1.9.3-p547/gems/json-1.8.1/lib/json/ext/parser.so: [BUG] Segmentation fault ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]

Looks like that is installing the wrong json or is using the wrong ruby. I sshd into the machine as root and removed it and installed it again. When I provision I still get the same error.

you can view my code on bitbucket. I commented out the rvm code since it prevents me from running provision a second time. https://bitbucket.org/yamiko/izanagi/

Module assumes there's a rvm group

Error: Could not set 'file' on ensure: Could not find group rvm at 8:/etc/puppet/modules/rvm/manifests/rvmrc.pp
Error: Could not set 'file' on ensure: Could not find group rvm at 8:/etc/puppet/modules/rvm/manifests/rvmrc.pp
Wrapped exception:
Could not find group rvm
Error: /Stage[main]/Rvm::Rvmrc/File[/etc/rvmrc]/ensure: change from absent to file failed: Could not set 'file' on ensure: Could not find group rvm at 8:/etc/puppet/modules/rvm/manifests/rvmrc.pp

run binaries from specific gem version...

I have a puppet module (that is far from ready for human consumption) to setup Nginx, passenger, rails, etc... following the example that RVM has for Apache. I am still using this RVM module for all things RVM. I just copied the passenger section to my own module and modified it to work for nginx. One problem that I recently had was how to select a specific version of the passenger gem to run the "passenger-install-nginx" from...

I have something that looks like:

  $rvm = "${rvm_prefix}rvm/bin/rvm"
  $passenger_module = "${ruby_version}/gems/passenger-${passenger_version}"

  exec { 'passenger-install-nginx-module':
    command     => "${rvm} ${ruby_version} exec passenger-install-nginx-module --auto --auto-download --prefix=${nginx_prefix}",
    environment => 'HOME=/root',
    provider    => shell,
    unless      => "[ -x ${nginx_prefix}/sbin/nginx ] && ${nginx_prefix}/sbin/nginx -V 2>&1 | grep -q ${passenger_module}",
    logoutput   => 'on_failure',
    require     => Class['rvm::passenger::gem'],
    subscribe   => [ Class['rvm::passenger::gem'], Rvm_system_ruby[$ruby_version] ],
  }

... and all was well until one day I changed the yaml file that selects the passenger version (in error, but whatever) to a lower version number (4.0.41 instead of 4.0.45 or whatever). The problem was that each time puppet ran, it would try to re-run the passenger-install-nginx-module because it was specifically looking for 4.0.41, and each time it ran that exec, it would select the newest version.

Consider this is probably a support request for an RVM/ruby novice ;)

~tommy

RVM not in PATH after installation

I have puppet installing RVM to /usr/local as expected, however rvm isn't available.

root@ubuntu:~# rvm
The program 'rvm' is currently not installed.  You can install it by typing:
apt-get install ruby-rvm
  • PATH doesn't contain any rvm directory.
  • current ruby (ruby -v) isn't rvm's default OR current ruby version, however a puppet (e.g. rvm_system_ruby) installed ruby is listed in /usr/local/rvm/bin/rvm list.

Are there any other installation steps required to have a fully working rvm?

From directory with .ruby-version, rvm_system_ruby never installs anything

I'm invoking puppet via puppet apply from a project directory that has a .ruby-version to request a specific ruby version of rvm or rbenv. However, when the rvm_system_ruby resource calls "rvm list strings" in that context, the output is:

ruby-2.0.0-p481 is not installed.
To install do: 'rvm install ruby-2.0.0-p481'

I'm guessing that puppet is calling "cd" or doing something else that triggers RVM to handle the .ruby-version as part of the shell command and that rvmcmd("list", "strings") runs in lib/puppet/provider/rvm_system_ruby/rvm_system_ruby.rb's "exists?" method.

Perhaps the ruby version regex we're looking for should be anchored to then beginning and end of line? Or at least the line should be excluded if it contains spaces? Or just if it includes "install"?

In the mean time, I'll call "puppet apply" from another directory...

Issue installing system wide and rails app

https://github.com/maestrodev/puppet-rvm/blob/maestrodev/manifests/system.pp#L13-14

The command to install RVM is run as root. According to RVM instructions this is wrong:

http://rvm.io/rvm/install

"Note: The Multi-User install instructions must be prefixed with the 'sudo' command. However, once the install is complete, and the instructions to add users to the rvm group is followed, the use of either sudo or rvmsudo is no longer required. The 'sudo' command is only to temporarily elevate privileges so the installer can complete it's work. If you need to use 'sudo' or 'rvmsudo' after the install is complete, some part of the install directions were not properly followed. This usually is because people execute the install as root, rather than executing the installation instructions from a non-privileged user account."

If you only use ruby from root it works, but using an RVM system user fails installing gems (password is required for sudo).

Invalid option when installing gems

RVM 1.20.9 on Ubuntu Precise, Ruby 2.0.0 RC1, provisioning fails with this error:

err: /Stage[main]//Rvm_gem[ruby-2.0.0-p195@depotapp/rails]/ensure: change from absent to 4.0.0.rc1 failed: Could not update: Execution of '/usr/local/rvm/bin/rvm ruby-2.0.0-p195@depotapp do gem install -v 4.0.0.rc1 --include-dependencies --no-rdoc --no-ri rails' returned 1: ERROR: While executing gem ... (OptionParser::InvalidOption)
invalid option: --include-dependencies
at /tmp/vagrant-puppet/manifests/precise64.pp:25

Manifest:

include rvm

rvm_system_ruby {
  'ruby-2.0.0-p195':
    ensure => 'present',
    default_use => true;
}

rvm_gemset {
  'ruby-2.0.0-p195@depotapp':
    ensure => 'present',
    require => Rvm_system_ruby['ruby-2.0.0-p195']
}

rvm_gem {
  'ruby-2.0.0-p195@depotapp/puppet':
    ensure => '3.1.1',
    require => Rvm_gemset['ruby-2.0.0-p195@depotapp'];
  'ruby-2.0.0-p195@depotapp/rails':
    ensure => '4.0.0.rc1',
    require => Rvm_gemset['ruby-2.0.0-p195@depotapp'];
  'ruby-2.0.0-p195@depotapp/bundler':
    ensure => '1.3.5',
    require => Rvm_gemset['ruby-2.0.0-p195@depotapp'];
}

Anything I'm doing wrong here or just some change in gem breaking everything for no good reason?

Gem not installing correctly

Hi! I'm struggling to get the rails-api gem installed correctly. I am using this puppet script for a Vagrant machine. Windows 8 host with Ubuntu 12.04 guest.

I use the snippet below in my manifest, and get no errors from the installation. But when I try to run rails-api, I get rails-api: command not found. Any help would be great!

RVM output from vagrant up

==> default: Notice: /Stage[main]/Install-rvm/Rvm_system_ruby[ruby-2.1.3]/ensure: created
==> default: Notice: /Stage[main]/Install-rvm/Rvm_gemset[ruby-2.1.3@myproject]/ensure: created
==> default: Notice: /Stage[main]/Install-rvm/Rvm_gem[ruby-2.1.3@myproject/rails-api]/ensure: created
==> default: Notice: /Stage[main]/Install-rvm/Rvm_gem[ruby-2.1.3@myproject/rake]/ensure: ensure changed '10.1.0' to 'latest'
==> default: Notice: /Stage[main]/Install-rvm/Rvm_gem[ruby-2.1.3@myproject/bundler]/ensure: ensure changed '1.7.3' to 'latest'

Section of manifest file installing RVM.

class install-rvm {
  include rvm
  rvm::system_user { vagrant: ; }

  rvm_system_ruby {
    'ruby-2.1.3':
      ensure => 'present',
      default_use => true;
  }

  rvm_gemset {
    'ruby-2.1.3@myproject':
      ensure  => present,
      require => Rvm_system_ruby['ruby-2.1.3'];
  }

  rvm_gem {
    'ruby-2.1.3@myproject/bundler': ensure => latest, require => Rvm_gemset['ruby-2.1.3@myproject'];
    'ruby-2.1.3@myproject/rails-api': ensure => '0.2.1', require => Rvm_gemset['ruby-2.1.3@myproject'];
    'ruby-2.1.3@myproject/rake': ensure => latest, require => Rvm_gemset['ruby-2.1.3@myproject'];
  }

}

class { 'install-rvm': }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.