GithubHelp home page GithubHelp logo

sous-chefs / rvm Goto Github PK

View Code? Open in Web Editor NEW
516.0 27.0 375.0 691 KB

Development repository for the rvm cookbook

Home Page: https://supermarket.chef.io/cookbooks/rvm

License: Apache License 2.0

Ruby 92.78% HTML 1.58% Shell 5.64%
rvm chef-cookbook chef chef-resource hacktoberfest managed-by-terraform

rvm's Introduction

RVM

chef-rvm Build Status

WARNING - Please read!

There is currently a major rewrite going on with this cookbook to simplify the interface to RVM with Chef. Expect the master branch to be very broken until there is a 1.0 release. All previous pull requests will need to rebase to the newer master to contribute to the newly re-factored resources.

Description

Manages system-wide and per-user RVMs and manages installed Rubies. Several resources are defined to accomplish these tasks.

Requirements

Chef

Tested on 12.5.1 but older versions of chef may not work due to the changes in the resource model. You are welcome to submit a pull request to add this support.

File an issue if this isn't the case.

Platform

The following platforms have been tested with this cookbook, meaning that the recipes and LWRPs run on these platforms without error:

  • ubuntu (12.04 and higher)
  • debian (6.0 and newer)
  • mac_os_x (10.6/10.7) (See Platform Notes)
  • mac_os_x_server (See Platform Notes)
  • suse (openSUSE, SLES)
  • centos
  • amazon (2011.09)
  • scientific
  • redhat
  • fedora
  • gentoo

Please report any additional platforms so they can be added.

Platform Notes

OSX

This cookbook suggests the homebrew cookbook, which is needed to install any additional packages needed to compile ruby. RVM now ships binary rubies, but will require homebrew to install any additional libraries.

Cookbooks

If you are installing JRuby then a Java runtime will need to be installed. The Opscode java cookbook can be used on supported platforms.

Installation

Depending on the situation and use case there are several ways to install this cookbook. All the methods listed below assume a tagged version release is the target, but omit the tags to get the head of development. A valid Chef repository structure like the Opscode repo is also assumed.

Using Berkshelf

Berkshelf is a way to manage a cookbook or an application's cookbook dependencies. Include the cookbook in your Berksfile, and then run berks install. To install using Berkshelf:

    gem install berkshelf
    cd chef-repo
    berks init
    echo "cookbook 'rvm', github: 'fnichol/chef-rvm'" >> Berksfile
    berks install

Using Librarian-Chef

Librarian-Chef is a bundler for your Chef cookbooks. Include a reference to the cookbook in a Cheffile and run librarian-chef install. To install Librarian-Chef:

    gem install librarian-chef
    cd chef-repo
    librarian-chef init
    cat >> Cheffile <<END_OF_CHEFFILE
    cookbook 'rvm',
      :git => 'git://github.com/fnichol/chef-rvm.git', :ref => 'v0.10.1'
    END_OF_CHEFFILE
    librarian-chef install

Recipes

default

Installs the RVM gem and initializes Chef to use the Resources in this cookbook for installing and managing RVM.

Contributing

See the CONTRIBUTING.md file

Testing

Make sure you have the following requirements setup:

After you bundle install run rake for unit tests and kitchen test for integration level tests.

License and Authors

Authors:: Aaron Kalin ([email protected])

Contributors:: https://github.com/sous-chefs/chef-rvm/contributors

Copyright:: 2010 - 2017, Aaron Kalin

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

rvm's People

Contributors

axelrtgs avatar bradphelan avatar bramswenson avatar cgriego avatar cmluciano avatar damacus avatar dosire avatar fnichol avatar johana-star avatar juzzin avatar kitchen-porter avatar lukeasrodgers avatar mariussturm avatar martinisoft avatar mpapis avatar ncreuschling avatar phlipper avatar powerschill avatar ramereth avatar renovate[bot] avatar rosenfeld avatar ryansch avatar smdern avatar tas50 avatar temujin9 avatar xdissent avatar xorima avatar xorimabot avatar zacharydanger avatar zsol 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  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  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  avatar  avatar  avatar  avatar

Watchers

 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

rvm's Issues

No Default RVM Ruby

Provide an easy way to disable having a default RVM Ruby while keeping the system Ruby as the default.

Currently, I have to:

node.override.rvm.delete("default_ruby")
node.override.rvm.install_rubies = "disable" # or I get an error

before:

include_recipe "rvm"
node.rvm.rubies.each do |rubie|
  rvm_ruby rubie
end
# because the rvm rubies otherwise won't get installed
# should also do the same thing with global gems

RVM string cache problem (in rvm_shell)

I have RVM installed system-wide, and I am doing something like this in a recipe:

rvm_shell "bundle install" do
  user        'vagrant'
  group       'vagrant'
  ...
end

Due to the setting of the user, canonical_ruby_string in Chef::RVM::StringCache looks for the rvm source file in the "vagrant" user's home directory. However, RVM is installed system-wide, so this causes it to break.

Perhaps it should check the user's home dir, and then fall back to the system wide location.

knife cookbook upload chef-rvm fails

Hi. I am very new (~1 day) to Chef so this in fact may not be a bug and may be user error. With that said, when I try to upload the Cookbook up to opscode, I get the following error

$ knife cookbook upload chef-rvm
ERROR: Chef::Exceptions::ValidationFailed: Option type must be equal to one of: string, array, hash, symbol! You passed "boolean".

It would appear the offending code is in metadata.rb:

attribute "rvm/install_rubies",
:display_name => "Can enable or disable installation of a default ruby and additional rubies set attribute metadata.",
:description => "Can enable or disable installation of a default ruby and additional rubies set attribute metadata. The primary use case for this attribute is when you don't want any rubies installed (but you want RVM installed).",
:type => "boolean",
:default => true

Any ideas on how to get around it? I tried changing :type to "string" and :default to "true" but for my troubles all I got was:

Uploading chef-rvm [0.6.0]
ERROR: EOFError: end of file reached

why chef-rvm and not rvm?

I am curious why this repo is called chef-rvm but the cookbook is named rvm. This would appear to require the name of the repo name be changed in order for the cookbook to work. Or am I missing something?

Update RVM install to use SSL URL

Looks like RVM now uses an SSL URL to download the installer. Just need to:

  • Tweak the rvm/installer_url attribute
  • Update the curl flags in rvm/recipes/system.rb
  • Test for regressions

Use `exec`.

In providers/shell.rb and libraries/helpers.rb, use exec #{new_resource.code} rather than just #{new_resource.code} and && exec #{cmd.gsub(/"/, '\"')} rather than just exec #{cmd.gsub(/"/, '\"')}.

Recipe fails on STDERR: sh: source: not found ---- End output of source /etc/profile.d/rvm.sh && rvm jruby-1.6.0@global gem env gempath ---- Ran source /etc/profile.d/rvm.sh && rvm jruby-1.6.0@global gem env gempath returned 127

The recipe fails when trying to install the bundler gem (this happens also on 1.9.2 not just jruby)

[Sat, 02 Apr 2011 14:02:52 +0000] ERROR: rvm_gem[bundler](/home/ronen/chef-meta/external/cookbooks/rvm/recipes/default.rb:51:in `from_file') had an error:
Expected process to exit 0, but it exited with 127
---- Begin output of source /etc/profile.d/rvm.sh && rvm jruby-1.6.0@global gem env gempath ----
STDOUT:
STDERR: sh: source: not found
---- End output of source /etc/profile.d/rvm.sh && rvm jruby-1.6.0@global gem env gempath ----

Add Vagrant/chef-solo wrapper script so the Chef gem is found on later runs

If the cookbook user is running with a Vagrant base box and a package or source installed Ruby, the installation of RVM with a default Ruby will "hide" that system Ruby. The next Vagrant provision run, the chef-solo binary is no longer in the user's PATH and the Chef run fails.

One solution is to install the Chef gem into the global_gems list:

:rvm => {
  :global_gems => [
    { :name => "bundler" },
    { :name => "rake" },
    { :name => "chef" }
  ]
}

Another solution is to use a wrapper script to "find" the original system Ruby Chef gem

Readme is too huge. Please split it in three.

Hey fnichol,

The readme is too large. IMO it should be split into 3 (maybe wiki) pages atleast. One each for recipes, attributes and LWRPs. That should make it very easy to navigate and search.

B/w thanks for the nice work. This is the most detailed rvm cookbook I've found.

Akash

Feature Suggestion: Add a `rubygems` resource.

Feature Suggestion: Add a rubygems resource.

And an accompanying rubygems provider.

Motivation:

The user may have installed ruby and its default rubygems some time ago, but may wish to keep current with rubygems or downgrade in case of rubygems issues.

Specification:

The resource should have a required attribute ruby_string to specify which rvm-managed ruby's rubygems to change.

The resource should have an optional attribute version to specify the version constraints on the rubygems for the named ruby. The version attribute should permit an exact version, and it should also permit a version constraint, a comma-separated string of version constraints, or an array of version constraints.

The resource should have a default action of install, but also an action of upgrade.

The install action should install/upgrade rubygems into the named ruby only if a version of rubygems complying with the version constraints from the version attribute is missing.

The upgrade action should always install/upgrade rubygems into the named ruby, unless the most-recent version of rubygems complying with the version constraints from the version attribute is already installed.

private method `chomp' called for nil:NilClass

Hi,

Pinged you on twitter about this about a month ago. I've updated to the latest release of your cookbook(0.8.4), and I'm still seeing this issue.

Thanks
-Miah

Massive log:
[Mon, 31 Oct 2011 22:26:33 +0000] INFO: Processing template[/etc/rvmrc] action create (rvm::system_install line 135)
[Mon, 31 Oct 2011 22:26:33 +0000] DEBUG: Not storing cookbooks/rvm/templates/default/rvmrc.erb, as the cache is up to date.
[Mon, 31 Oct 2011 22:26:33 +0000] DEBUG: Current content's checksum: 46241de8af5d3e5ab9d01f128992a6d6f44412cfb730963c964593c7f94e772c
[Mon, 31 Oct 2011 22:26:33 +0000] DEBUG: Rendered content's checksum: 46241de8af5d3e5ab9d01f128992a6d6f44412cfb730963c964593c7f94e772c
[Mon, 31 Oct 2011 22:26:33 +0000] DEBUG: template[/etc/rvmrc] content has not changed.
[Mon, 31 Oct 2011 22:26:33 +0000] INFO: Processing execute[install system-wide RVM] action run (rvm::system_install line 69)
[Mon, 31 Oct 2011 22:26:33 +0000] DEBUG: Executing bash -c "source /etc/profile.d/rvm.sh && type rvm | head -1 | grep -q '^rvm is a function$'"
[Mon, 31 Oct 2011 22:26:33 +0000] DEBUG: ---- Begin output of bash -c "source /etc/profile.d/rvm.sh && type rvm | head -1 | grep -q '^rvm is a function$'" ----
[Mon, 31 Oct 2011 22:26:33 +0000] DEBUG: STDOUT:
[Mon, 31 Oct 2011 22:26:33 +0000] DEBUG: STDERR: bash: line 0: type: write error: Broken pipe
[Mon, 31 Oct 2011 22:26:33 +0000] DEBUG: ---- End output of bash -c "source /etc/profile.d/rvm.sh && type rvm | head -1 | grep -q '^rvm is a function$'" ----
[Mon, 31 Oct 2011 22:26:33 +0000] DEBUG: Ran bash -c "source /etc/profile.d/rvm.sh && type rvm | head -1 | grep -q '^rvm is a function$'" returned 0
[Mon, 31 Oct 2011 22:26:33 +0000] DEBUG: Skipping execute[install system-wide RVM] due to not_if
[Mon, 31 Oct 2011 22:26:33 +0000] INFO: Processing execute[upgrade system-wide RVM to none] action run (rvm::system_install line 105)
[Mon, 31 Oct 2011 22:26:33 +0000] DEBUG: Skipping execute[upgrade system-wide RVM to none] due to only_if
[Mon, 31 Oct 2011 22:26:33 +0000] INFO: Processing rvm_default_ruby[ruby-1.9.2-p290] action create (rvm::system line 32)
[Mon, 31 Oct 2011 22:26:33 +0000] DEBUG: RVM::Shell::ChefWrapper subprocess executing with environment of: [{}].
[Mon, 31 Oct 2011 22:26:33 +0000] DEBUG: RVM::Shell::ChefWrapper silently executing: [source '/usr/lib/ruby/gems/1.8/gems/rvm-1.9.2/lib/rvm/shell/shell_wrapper.sh'; __rvm_show_command_epilog]
[Mon, 31 Oct 2011 22:26:34 +0000] DEBUG: RVM::Shell::ChefWrapper silently executing: [export rvm_path='/usr/local/rvm'; __rvm_show_command_epilog]
[Mon, 31 Oct 2011 22:26:34 +0000] DEBUG: RVM::Shell::ChefWrapper silently executing: [source '/usr/local/rvm/scripts/rvm'; __rvm_show_command_epilog]
[Mon, 31 Oct 2011 22:26:34 +0000] DEBUG: RVM::Shell::ChefWrapper silently executing: [rvm 'use' 'default'; __rvm_show_command_epilog]
[Mon, 31 Oct 2011 22:26:34 +0000] DEBUG: RVM::Shell::ChefWrapper executing: [rvm 'list' 'default' 'string'; __rvm_show_command_epilog]
[Mon, 31 Oct 2011 22:26:35 +0000] DEBUG: Chef::Provider::RvmDefaultRuby: ruby-1.9.2-p290' is already default, so skipping [Mon, 31 Oct 2011 22:26:35 +0000] INFO: Processing rvm_global_gem[bundler] action install (rvm::system line 36) [Mon, 31 Oct 2011 22:26:35 +0000] INFO: Processing execute[Add bundler to /usr/local/rvm/gemsets/global.gems] action run (/var/cache/chef/cookbooks/rvm/providers/global_gem.rb line 102) [Mon, 31 Oct 2011 22:26:35 +0000] DEBUG: Executing grep -q "^bundler" "/usr/local/rvm/gemsets/global.gems" [Mon, 31 Oct 2011 22:26:35 +0000] DEBUG: ---- Begin output of grep -q "^bundler" "/usr/local/rvm/gemsets/global.gems" ---- [Mon, 31 Oct 2011 22:26:35 +0000] DEBUG: STDOUT: [Mon, 31 Oct 2011 22:26:35 +0000] DEBUG: STDERR: [Mon, 31 Oct 2011 22:26:35 +0000] DEBUG: ---- End output of grep -q "^bundler" "/usr/local/rvm/gemsets/global.gems" ---- [Mon, 31 Oct 2011 22:26:35 +0000] DEBUG: Ran grep -q "^bundler" "/usr/local/rvm/gemsets/global.gems" returned 0 [Mon, 31 Oct 2011 22:26:35 +0000] DEBUG: Skipping execute[Add bundler to /usr/local/rvm/gemsets/global.gems] due to not_if [Mon, 31 Oct 2011 22:26:35 +0000] DEBUG: RVM::Shell::ChefWrapper subprocess executing with environment of: [{}]. [Mon, 31 Oct 2011 22:26:35 +0000] DEBUG: RVM::Shell::ChefWrapper silently executing: [source '/usr/lib/ruby/gems/1.8/gems/rvm-1.9.2/lib/rvm/shell/shell_wrapper.sh'; __rvm_show_command_epilog] [Mon, 31 Oct 2011 22:26:35 +0000] DEBUG: RVM::Shell::ChefWrapper silently executing: [export rvm_path='/usr/local/rvm'; __rvm_show_command_epilog] [Mon, 31 Oct 2011 22:26:35 +0000] DEBUG: RVM::Shell::ChefWrapper silently executing: [source '/usr/local/rvm/scripts/rvm'; __rvm_show_command_epilog] [Mon, 31 Oct 2011 22:26:35 +0000] DEBUG: RVM::Shell::ChefWrapper silently executing: [rvm 'use' 'default'; __rvm_show_command_epilog] [Mon, 31 Oct 2011 22:26:35 +0000] DEBUG: RVM::Shell::ChefWrapper executing: [rvm 'list' 'strings'; __rvm_show_command_epilog] [Mon, 31 Oct 2011 22:26:36 +0000] INFO: Processing rvm_gem[bundler] action install (/var/cache/chef/cookbooks/rvm/providers/global_gem.rb line 76) [Mon, 31 Oct 2011 22:26:36 +0000] DEBUG: sh(bash -c "source /etc/profile.d/rvm.sh && rvm ruby-1.9.2-p290@global do gem env gempath") [Mon, 31 Oct 2011 22:26:38 +0000] DEBUG: rvm_gem[bundler] found installed gem bundler version 1.0.21 matching bundler (>= 0, runtime) [Mon, 31 Oct 2011 22:26:38 +0000] DEBUG: rvm_gem[bundler] is already installed - nothing to do [Mon, 31 Oct 2011 22:26:38 +0000] INFO: Processing execute[Add bundler to /usr/local/rvm/gemsets/global.gems] action nothing (/var/cache/chef/cookbooks/rvm/providers/global_gem.rb line 102) [Mon, 31 Oct 2011 22:26:38 +0000] DEBUG: Executing grep -q "^bundler" "/usr/local/rvm/gemsets/global.gems" [Mon, 31 Oct 2011 22:26:38 +0000] DEBUG: ---- Begin output of grep -q "^bundler" "/usr/local/rvm/gemsets/global.gems" ---- [Mon, 31 Oct 2011 22:26:38 +0000] DEBUG: STDOUT: [Mon, 31 Oct 2011 22:26:38 +0000] DEBUG: STDERR: [Mon, 31 Oct 2011 22:26:38 +0000] DEBUG: ---- End output of grep -q "^bundler" "/usr/local/rvm/gemsets/global.gems" ---- [Mon, 31 Oct 2011 22:26:38 +0000] DEBUG: Ran grep -q "^bundler" "/usr/local/rvm/gemsets/global.gems" returned 0 [Mon, 31 Oct 2011 22:26:38 +0000] DEBUG: Skipping execute[Add bundler to /usr/local/rvm/gemsets/global.gems] due to not_if [Mon, 31 Oct 2011 22:26:38 +0000] INFO: Processing rvm_gem[bundler] action nothing (/var/cache/chef/cookbooks/rvm/providers/global_gem.rb line 76) [Mon, 31 Oct 2011 22:26:38 +0000] DEBUG: sh(bash -c "source /etc/profile.d/rvm.sh && rvm ruby-1.9.2-p290@global do gem env gempath") [Mon, 31 Oct 2011 22:26:40 +0000] DEBUG: rvm_gem[bundler] found installed gem bundler version 1.0.21 matching bundler (>= 0, runtime) [Mon, 31 Oct 2011 22:26:40 +0000] DEBUG: Doing nothing for rvm_gem[bundler] [Mon, 31 Oct 2011 22:26:40 +0000] INFO: Processing rvm_global_gem[rake] action install (rvm::system line 36) [Mon, 31 Oct 2011 22:26:40 +0000] INFO: Processing execute[Add rake to /usr/local/rvm/gemsets/global.gems] action run (/var/cache/chef/cookbooks/rvm/providers/global_gem.rb line 102) [Mon, 31 Oct 2011 22:26:40 +0000] DEBUG: Executing grep -q "^rake" "/usr/local/rvm/gemsets/global.gems" [Mon, 31 Oct 2011 22:26:40 +0000] DEBUG: ---- Begin output of grep -q "^rake" "/usr/local/rvm/gemsets/global.gems" ---- [Mon, 31 Oct 2011 22:26:40 +0000] DEBUG: STDOUT: [Mon, 31 Oct 2011 22:26:40 +0000] DEBUG: STDERR: [Mon, 31 Oct 2011 22:26:40 +0000] DEBUG: ---- End output of grep -q "^rake" "/usr/local/rvm/gemsets/global.gems" ---- [Mon, 31 Oct 2011 22:26:40 +0000] DEBUG: Ran grep -q "^rake" "/usr/local/rvm/gemsets/global.gems" returned 0 [Mon, 31 Oct 2011 22:26:40 +0000] DEBUG: Skipping execute[Add rake to /usr/local/rvm/gemsets/global.gems] due to not_if [Mon, 31 Oct 2011 22:26:40 +0000] DEBUG: RVM::Shell::ChefWrapper subprocess executing with environment of: [{}]. [Mon, 31 Oct 2011 22:26:41 +0000] DEBUG: RVM::Shell::ChefWrapper silently executing: [source '/usr/lib/ruby/gems/1.8/gems/rvm-1.9.2/lib/rvm/shell/shell_wrapper.sh'; __rvm_show_command_epilog] [Mon, 31 Oct 2011 22:26:41 +0000] DEBUG: RVM::Shell::ChefWrapper silently executing: [export rvm_path='/usr/local/rvm'; __rvm_show_command_epilog] [Mon, 31 Oct 2011 22:26:41 +0000] DEBUG: RVM::Shell::ChefWrapper silently executing: [source '/usr/local/rvm/scripts/rvm'; __rvm_show_command_epilog] [Mon, 31 Oct 2011 22:26:41 +0000] DEBUG: RVM::Shell::ChefWrapper silently executing: [rvm 'use' 'default'; __rvm_show_command_epilog] [Mon, 31 Oct 2011 22:26:41 +0000] DEBUG: RVM::Shell::ChefWrapper executing: [rvm 'list' 'strings'; __rvm_show_command_epilog] [Mon, 31 Oct 2011 22:26:42 +0000] INFO: Processing rvm_gem[rake] action install (/var/cache/chef/cookbooks/rvm/providers/global_gem.rb line 76) [Mon, 31 Oct 2011 22:26:42 +0000] DEBUG: sh(bash -c "source /etc/profile.d/rvm.sh && rvm ruby-1.9.2-p290@global do gem env gempath") [Mon, 31 Oct 2011 22:26:44 +0000] DEBUG: rvm_gem[rake] found installed gem rake version 0.9.2 matching rake (= 0.9.2, runtime) [Mon, 31 Oct 2011 22:26:44 +0000] DEBUG: rvm_gem[rake] is already installed - nothing to do [Mon, 31 Oct 2011 22:26:44 +0000] INFO: Processing execute[Add rake to /usr/local/rvm/gemsets/global.gems] action nothing (/var/cache/chef/cookbooks/rvm/providers/global_gem.rb line 102) [Mon, 31 Oct 2011 22:26:44 +0000] DEBUG: Executing grep -q "^rake" "/usr/local/rvm/gemsets/global.gems" [Mon, 31 Oct 2011 22:26:44 +0000] DEBUG: ---- Begin output of grep -q "^rake" "/usr/local/rvm/gemsets/global.gems" ---- [Mon, 31 Oct 2011 22:26:44 +0000] DEBUG: STDOUT: [Mon, 31 Oct 2011 22:26:44 +0000] DEBUG: STDERR: [Mon, 31 Oct 2011 22:26:44 +0000] DEBUG: ---- End output of grep -q "^rake" "/usr/local/rvm/gemsets/global.gems" ---- [Mon, 31 Oct 2011 22:26:44 +0000] DEBUG: Ran grep -q "^rake" "/usr/local/rvm/gemsets/global.gems" returned 0 [Mon, 31 Oct 2011 22:26:44 +0000] DEBUG: Skipping execute[Add rake to /usr/local/rvm/gemsets/global.gems] due to not_if [Mon, 31 Oct 2011 22:26:44 +0000] INFO: Processing rvm_gem[rake] action nothing (/var/cache/chef/cookbooks/rvm/providers/global_gem.rb line 76) [Mon, 31 Oct 2011 22:26:44 +0000] DEBUG: sh(bash -c "source /etc/profile.d/rvm.sh && rvm ruby-1.9.2-p290@global do gem env gempath") [Mon, 31 Oct 2011 22:26:46 +0000] DEBUG: rvm_gem[rake] found installed gem rake version 0.9.2 matching rake (= 0.9.2, runtime) [Mon, 31 Oct 2011 22:26:46 +0000] DEBUG: Doing nothing for rvm_gem[rake] [Mon, 31 Oct 2011 22:26:46 +0000] INFO: Processing rvm_default_ruby[ruby-1.9.2-p290@chef-rundeck] action create (rundeck::chef line 21) [Mon, 31 Oct 2011 22:26:46 +0000] DEBUG: Fetching canonical RVM string for: ruby-1.9.2-p290 (rundeck) [Mon, 31 Oct 2011 22:26:46 +0000] ERROR: rvm_default_ruby[ruby-1.9.2-p290@chef-rundeck] (rundeck::chef line 21) has had an error [Mon, 31 Oct 2011 22:26:46 +0000] ERROR: Running exception handlers [Mon, 31 Oct 2011 22:26:47 +0000] FATAL: Saving node information to /var/cache/chef/failed-run-data.json [Mon, 31 Oct 2011 22:26:47 +0000] ERROR: Exception handlers complete [Mon, 31 Oct 2011 22:26:47 +0000] DEBUG: Re-raising exception: NoMethodError - rvm_default_ruby[ruby-1.9.2-p290@chef-rundeck] (rundeck::chef line 21) had an error: private methodchomp' called for nil:NilClass
/var/cache/chef/cookbooks/rvm/libraries/chef_rvm_string_cache.rb:77:in canonical_ruby_string' /var/cache/chef/cookbooks/rvm/libraries/chef_rvm_string_cache.rb:50:infetch'
/var/cache/chef/cookbooks/rvm/libraries/chef_rvm_string_helpers.rb:55:in normalize_ruby_string' /var/cache/chef/cookbooks/rvm/providers/default_ruby.rb:26:inload_current_resource'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/resource.rb:416:in run_action' /usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/runner.rb:45:inrun_action'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/runner.rb:78:in converge' /usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/runner.rb:78:ineach'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/runner.rb:78:in converge' /usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/resource_collection.rb:94:inexecute_each_resource'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in call' /usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:incall_iterator_block'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:85:in step' /usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:104:initerate'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:55:in each_with_index' /usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/resource_collection.rb:92:inexecute_each_resource'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/runner.rb:76:in converge' /usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/client.rb:312:inconverge'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/client.rb:160:in run' /usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/application/client.rb:239:inrun_application'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/application/client.rb:229:in loop' /usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/application/client.rb:229:inrun_application'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/application.rb:66:in run' /usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/chef-client:26 /usr/bin/chef-client:19:inload'
/usr/bin/chef-client:19
[Mon, 31 Oct 2011 22:26:47 +0000] ERROR: NoMethodError: rvm_default_ruby[ruby-1.9.2-p290@chef-rundeck](rundeck::chef line 21) had an error: private method chomp' called for nil:NilClass [Mon, 31 Oct 2011 22:26:47 +0000] FATAL: Stacktrace dumped to /var/cache/chef/chef-stacktrace.out [Mon, 31 Oct 2011 22:26:47 +0000] DEBUG: NoMethodError: rvm_default_ruby[ruby-1.9.2-p290@chef-rundeck] (rundeck::chef line 21) had an error: private methodchomp' called for nil:NilClass
/var/cache/chef/cookbooks/rvm/libraries/chef_rvm_string_cache.rb:77:in canonical_ruby_string' /var/cache/chef/cookbooks/rvm/libraries/chef_rvm_string_cache.rb:50:infetch'
/var/cache/chef/cookbooks/rvm/libraries/chef_rvm_string_helpers.rb:55:in normalize_ruby_string' /var/cache/chef/cookbooks/rvm/providers/default_ruby.rb:26:inload_current_resource'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/resource.rb:416:in run_action' /usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/runner.rb:45:inrun_action'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/runner.rb:78:in converge' /usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/runner.rb:78:ineach'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/runner.rb:78:in converge' /usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/resource_collection.rb:94:inexecute_each_resource'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in call' /usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:incall_iterator_block'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:85:in step' /usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:104:initerate'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:55:in each_with_index' /usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/resource_collection.rb:92:inexecute_each_resource'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/runner.rb:76:in converge' /usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/client.rb:312:inconverge'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/client.rb:160:in run' /usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/application/client.rb:239:inrun_application'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/application/client.rb:229:in loop' /usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/application/client.rb:229:inrun_application'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/application.rb:66:in run' /usr/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/chef-client:26 /usr/bin/chef-client:19:inload'
/usr/bin/chef-client:19
[Mon, 31 Oct 2011 22:26:47 +0000] ERROR: Sleeping for 1800 seconds before trying again

NameError: wrong constant name Chef-rvmGlobalGem

When I run the default Chef-RVM recipe from Vagrant with this very simple Vagrantfile:

Vagrant::Config.run do |config|
  config.vm.box = 'lucid32'
  config.vm.provision :chef_solo do |chef|
    chef.cookbooks_path = 'cookbooks'
    chef.add_recipe 'rvm'
  end
end

I get the following error when provisioning:

[default] Provisioning enabled with chef_solo...
[default] Running provisioner: Vagrant::Provisioners::ChefSolo...
[default] Generating chef JSON and uploading...
[default] Running chef-solo...
[default] [Wed, 15 Jun 2011 01:57:10 +0000] INFO: *** Chef 0.10.0 ***
[default] [Wed, 15 Jun 2011 01:57:11 +0000] INFO: Setting the run_list to ["recipe[rvm]"] from JSON
[default] [Wed, 15 Jun 2011 01:57:11 +0000] INFO: Run List is [recipe[rvm]]
[default] [Wed, 15 Jun 2011 01:57:11 +0000] INFO: Run List expands to [rvm]
[default] [Wed, 15 Jun 2011 01:57:11 +0000] INFO: Starting Chef Run for vagrant-lucid32.vagrantup.com
[default] [Wed, 15 Jun 2011 01:57:11 +0000] WARN: Missing gem 'rvm'
[default] [Wed, 15 Jun 2011 01:57:11 +0000] ERROR: Running exception handlers
[default] [Wed, 15 Jun 2011 01:57:11 +0000] ERROR: Exception handlers complete
[default] [Wed, 15 Jun 2011 01:57:11 +0000] FATAL: Stacktrace dumped to /tmp/vagrant-chef/chef-stacktrace.out
[default] [Wed, 15 Jun 2011 01:57:11 +0000] FATAL: NameError: wrong constant name Chef-rvmGlobalGem

The stack trace dumped to /tmp/vagrant-chef/chef-stacktrace.out (in the VM) is:

/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/provider.rb:89:in const_defined?' /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/provider.rb:89:inbuild_from_file'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/run_context.rb:89
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/run_context.rb:120:in call' /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/run_context.rb:120:inforeach_cookbook_load_segment'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/run_context.rb:119:in each' /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/run_context.rb:119:inforeach_cookbook_load_segment'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/run_context.rb:117:in each' /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/run_context.rb:117:inforeach_cookbook_load_segment'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/run_context.rb:87:in load_lwrp_providers' /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/run_context.rb:58:inload'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/client.rb:195:in setup_run_context' /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/client.rb:159:inrun'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/application/solo.rb:192:in run_application' /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/application/solo.rb:183:inloop'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/application/solo.rb:183:in run_application' /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/application.rb:66:inrun'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/chef-solo:25
/usr/bin/chef-solo:19:in `load'
/usr/bin/chef-solo:19

chef .9 and arrays in attributes

I would really like to get this working on chef .9, which is the highest version of chef that RightScale supports.

It would seem that the issue is that chef .9 doesn't handle attributes that are arrays or hashes. I was trying to think of a workaround for this, such as setting the attribute as a string and then parsing it. Is this something that you see as a workable solution?

Cannot install bundler & rake

We try to run this recipe on Ubuntu machine with this:

include_recipe "rvm::system"

and this node configuration:
"rvm": { "install_rubies": true, "rubies": ["1.9.2"] }

However, we are running into this:

rvm_gem[bundler] (/home/internal/chef-dir/cookbooks/rvm/providers/global_gem.rb line 76) had an error: Malformed version number string 1.10.0-pre

Perhaps this may help you imagine what happening:

[Mon, 28 Nov 2011 12:15:09 +0000] INFO: Processing rvm_gem[bundler] action install (/home/internal/chef-dir/cookbooks/rvm/providers/global_gem.rb line 76) [Mon, 28 Nov 2011 12:15:09 +0000] ERROR: rvm_gem[bundler] (/home/internal/chef-dir/cookbooks/rvm/providers/global_gem.rb line 76) has had an error [Mon, 28 Nov 2011 12:15:09 +0000] ERROR: rvm_global_gem[bundler] (rvm::system line 36) has had an error [Mon, 28 Nov 2011 12:15:09 +0000] ERROR: rvm_global_gem[bundler] (/home/internal/chef-dir/cookbooks/rvm/recipes/system.rb:36:in 'from_file') had an error: rvm_global_gem[bundler] (rvm::system line 36) had an error: rvm_gem[bundler] (/home/internal/chef-dir/cookbooks/rvm/providers/global_gem.rb line 76) had an error: Malformed version number string 1.10.0-pre /usr/local/lib/site_ruby/1.8/rubygems/version.rb:187:in 'initialize' /home/internal/chef-dir/cookbooks/rvm/libraries/chef_rvm_set_helpers.rb:6:in 'new' /home/internal/chef-dir/cookbooks/rvm/libraries/chef_rvm_set_helpers.rb:6:in 'rvm_do' /home/internal/chef-dir/cookbooks/rvm/libraries/rvm_rubygems_package.rb:52:in 'gem_paths'

Don't know why 1.10.0-pre is there, since the latest version of bundler should be '1.1.rc'

include Chef::RVM::StringHelpers to provide select_ruby function

chef-gitorious calls select_ruby from it's default recipe and is relying on the rvm cookbook to provide that method.

diff --git a/recipes/default.rb b/recipes/default.rb
index d637280..6e35026 100644
--- a/recipes/default.rb
+++ b/recipes/default.rb
@@ -36,4 +36,5 @@ end
class Chef::Recipe

mix in recipe helpers

include Chef::RVM::RecipeHelpers

  • include Chef::RVM::StringHelpers
    end

Trouble getting rvm::user working

I ran rvm::system. Works perfect. rvm is there. I want to do it per the vagrant use for our vagrant-rails project. Here is my recipe and it simply doesn't work. What am I doing wrong?

node['rvm']['user_installs'] = [
{ 'user' => 'vagrant',
'global_gems' => [ { 'name' => 'bundler' } ]
}
]

rvm head (after 1.8.6): new set/alias behavior

See rvm/rvm#494

rvm 1.9.0 will support the following syntax:

# rvm [ruby] do something :
rvm default do something
rvm default@gemset do something
rvm /path/to/project do something
rvm default@gemset

rvm use /path/to/project

rvm install ruby-named ; rvm use ruby-named

I ran into this not working in 1.8.6 when trying to use rvm_gem without specifying the ruby_string. It defaults to 'default' which fails horribly on both 1.6.5 and 1.8.6.

I have a local patch to the cookbook that can resolve 'default' to ruby@gemset. Are you interested in seeing it or should we just rely on this new functionality?

Recipe to install RVM locally for a user

This can be useful for special system users needing more ruby isolation. Main use case here for me is to allow the user running a Hudson/Jenkins instance to add more rubies and spin up gemsets while leaving a system-wide RVM install alone. We might not want to impact a production running passenger or rails stack running while performing CI tasks.

Tentative idea is to have an rvm::user recipe that will iterate over an rvm/user_installs array of system users. Issues to solve are how to set defaults such as default_ruby and gems in some kind of hash that isn't overly complicated.

JRuby install issue

Now that I've grabbed the workaround from @fnordfish, I can't seem to get jruby-1.6.1 to install. It says to check the logs, but there are none. Here's what I think is happening:

  • I've set recipe[java] before recipe[rvm] in the role I'm installing
  • The OpenJDK installs before RVM goes to install JRuby
  • JRuby install fails
  • Then I see that the OpenJDK gets set as a possible JVM with update-alternatives

I saw that there was a line somewhere in the RVM helpers (commented out) that included the Java recipe. Is there any way to ensure that the Java recipe is complete and installed before RVM starts installing?

Thanks!
Cody

notifies from within rvm_shell doesn't trigger

Hi,
I am trying to use notifies from within rvm_shell but having trouble.

For example:

ruby_block "a block" do
block do
Chef::Log.info("my block ran")
end

action :nothing

end

rvm_shell "a command" do
code "echo foobar"
notifies :create, "ruby_block[a block]", :immediately
end

results in the output:
[Thu, 26 Jan 2012 00:49:14 -0800] INFO: Starting Chef Run (Version 0.9.12)
[Thu, 26 Jan 2012 00:50:07 -0800] INFO: Ran script[a command] successfully
[Thu, 26 Jan 2012 00:50:08 -0800] INFO: Chef Run complete in 14.732362 seconds
[Thu, 26 Jan 2012 00:50:08 -0800] INFO: cleaning the checksum cache
[Thu, 26 Jan 2012 00:50:09 -0800] INFO: Running report handlers
[Thu, 26 Jan 2012 00:50:09 -0800] INFO: Report handlers complete

A set version of RVM can be installed (rather than only HEAD)

In order to have more reproducible deployments over time, there should be a mechanism to install a specific tagged version (or git SHA hash) of RVM.

  • The RVM install-system-wide script has a --revision X flag which can target a commit ID or git tag
  • A local install of RVM could checkout a on a commit ID or git tag (i.e. cd $HOME/rvm/srv/rvm && git checkout 1.0.0 && $PWD/scripts/install)

Defaults

In my recipes I typically want the RVM resources, but not the defaults the RVM attributes/recipies set.

I like having the cookbook provide me with the tools to manage RVM resources in the form of the LW resources/providers. But I typically start with

node.rvm.default_ruby = "system"
node.rvm.rubies.clear
node.rvm.global_gems.clear
include_recipe "rvm"

because I don't need the defaults.

If

gem_package 'rvm' do
  action :nothing
end.run_action(:install)

require 'rubygems'
Gem.clear_paths
require 'rvm'
create_rvm_shell_chef_wrapper
create_rvm_chef_user_environment

were in recipes/system.rb, that would be very helpful. Then I could `include_recipe "rvm::system" and have RVM installed, but without any default RVM rubies/gems that I don't need.

Don't require full ruby version info

When I don't explicitly set the ruby version info like:

      "rubies": [
        "jruby"
      ],

It outputs the following warning and doesn't install the ruby:

WARN: rvm_ruby[jruby] is either not fully qualified or not known . Uservm list knownto get a full list.

It appears you must explicitly set the version number. This works:

      "rubies": [
        "jruby-1.6.3"
      ],

It would be handy to be able to reference the ruby without version number and let rvm default to the most recent version -- what rvm install jruby would do.

latest rvm: install via gem command needs 'exec' (or 'do')

Just a heads up really. Latest RVM has changed the implicit exec to explicit, as in...

from:

rvm ruby-1.9.2-p290@global gem install rspec -q --no-rdoc --no-ri

to:

rvm ruby-1.9.2-p290@global exec gem install rspec -q --no-rdoc --no-ri

I think I changed the correct area in libraries/rvm_rubygems_package.rb

def install_via_gem_command(name, version)
src = @new_resource.source &&
" --source=#{@new_resource.source} --source=http://rubygems.org"

      cmd = %{rvm #{ruby_strings.join(',')} exec #{gem_binary_path}}
      cmd << %{ install #{name} -q --no-rdoc --no-ri -v "#{version}"}
      cmd << %{#{src}#{opts}}

...

and the same for uninstall

However, according to the RVM guys (rvm/rvm#487 (comment)) 'exec' is changing to 'do'

HTH
Guy

cannot create /usr/local/rvm/gemsets/global.gems: Directory nonexistent

I just want to install rvm for a user
but I keep getting: cannot create /usr/local/rvm/gemsets/global.gems: Directory nonexistent

is this the right way to install rvm under the user 'hugo' ? thanks

include_recipe "rvm::user"

node['rvm']['user_installs'] = [
  'hugo' => {
    'default_ruby'  => 'ruby-1.9.2-p290', 
    'rubies'        => ['1.9.2'],
    'rvmrc'         => {
      'rvm_project_rvmrc'             => 1,
      'rvm_gemset_create_on_use_flag' => 1,
      'rvm_pretty_print_flag'         => 1
    },

    'global_gems'   => []
  }
]

node['rvm']['user_global_gems'] = [
  { 'name'    => 'bundler',
    'version' => '1.0.17'
  },
  { 'name'    => 'rake',
    'version' => '0.9.2'
  }
]

WARN: Missing gem 'rvm'

I tried to install rvm using your recipe and chef-hosted. For this purpose i have a freshly installed debian 6.0.2 virtualbox image with chef preinstalled. The only recipe in the run_list is rvm-chef. After downloading the cookbook the chef-client stops with this error message:

[Sun, 31 Jul 2011 12:20:16 +0200] WARN: Missing gem 'rvm'
[Sun, 31 Jul 2011 12:20:16 +0200] ERROR: Running exception handlers
[Sun, 31 Jul 2011 12:20:16 +0200] FATAL: Saving node information to /var/chef/cache/failed-run-data.json
[Sun, 31 Jul 2011 12:20:16 +0200] ERROR: Exception handlers complete
[Sun, 31 Jul 2011 12:20:16 +0200] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[Sun, 31 Jul 2011 12:20:16 +0200] FATAL: NameError: wrong constant name Chef-rvmGlobalGem

Do you have any idea how to overcome this? Any help is appreciated!

Cheers, Christoph

`rvm rubygems` errors out

I have been unable to run the rvm rubygems command

 $ rvm rubygems 1.5.2

from a fresh Vagrant virtual machine configured with chef-rvm 0.8.2 (the RVM version installed is 1.6.10). I get the following stacktrace:

Removing old Rubygems files...
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/ubygems.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/gauntlet_rubygems.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rbconfig/datadir.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/package/tar_reader.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/package/f_sync_dir.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/package/tar_reader/entry.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/package/tar_test_case.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/package/tar_output.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/package/tar_header.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/package/tar_writer.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/builder.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/dependency.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/test_utilities.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/requirement.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/server.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/local_remote_options.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/format.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/gemcutter_utilities.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/errors.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/version_option.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/install_update_options.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/dependency_installer.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/installer.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/mock_gem_ui.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/ext/builder.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/ext/rake_builder.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/ext/ext_conf_builder.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/ext/configure_builder.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/platform.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/ext.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/user_interaction.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/package.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/gem_path_searcher.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/path_support.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/old_format.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/deprecate.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/exceptions.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/version.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/test_case.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/security.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/doc_manager.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/gem_openssl.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/specification.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/uninstaller.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/command.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/config_file.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/commands/pristine_command.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/commands/environment_command.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/commands/help_command.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/commands/list_command.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/commands/uninstall_command.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/commands/owner_command.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/commands/server_command.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/commands/cleanup_command.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/commands/specification_command.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/commands/cert_command.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/commands/unpack_command.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/commands/sources_command.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/commands/push_command.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/commands/fetch_command.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/commands/outdated_command.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/commands/generate_index_command.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/commands/which_command.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/commands/search_command.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/commands/update_command.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/commands/setup_command.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/commands/check_command.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/commands/stale_command.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/commands/dependency_command.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/commands/query_command.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/commands/contents_command.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/commands/build_command.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/commands/rdoc_command.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/commands/lock_command.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/text.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/installer_test_case.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/dependency_list.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/source_index.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/defaults.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/package_task.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/indexer.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/validator.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/require_paths_builder.rb': Permission denied
rm: cannot remove `/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems.rb': Permission denied
Installing rubygems-1.5.2 for ree-1.8.7-2011.03 ...
ERROR: Error running 'GEM_PATH="/usr/local/rvm/gems/ree-1.8.7-2011.03:/usr/local/rvm/gems/ree-1.8.7-2011.03@global:/usr/local/rvm/gems/ree-1.8.7-2011.03:/usr/local/rvm/gems/ree-1.8.7-2011.03@global" GEM_HOME="/usr/local/rvm/gems/ree-1.8.7-2011.03" "/usr/local/rvm/rubies/ree-1.8.7-2011.03/bin/ruby" "/usr/local/rvm/src/rubygems-1.5.2/setup.rb"', please read /usr/local/rvm/log/ree-1.8.7-2011.03/rubygems.install.log
WARN: Installation of rubygems did not complete successfully.

rvm_shell not setting environment variables on system install

Hi,

I am using the system based install and no individual user rvm. I am trying to run a command that depends on the correct HOME environment variable being set as the user running the command. However, I am finding $HOME is set to the home of the user running the chef-client command. For example:

rvm_shell "a command" do
code "echo $HOME > /tmp/env.txt"
user "chris"
end

then suppose I start my chef-client run with rvmsudo as user "ubuntu"

this command will output with the text "/home/ubuntu", when I would expect it to be "/home/chris".

So I dug into the code and modified providers/shell.rb and changed lines 80-85 to:
if new_resource.user && new_resource.environment
environment({ 'USER' => new_resource.user, 'HOME' => user_home }.merge(
new_resource.environment))
elsif new_resource.user
environment({ 'USER' => new_resource.user, 'HOME' => user_home })
end

Anyhow, I'm not sure if that is the correct fix, but it did the trick for me.

-Chris

Speed up install by disabling RDOC generation

I've noticed that a lot of CPU time and memory is used by a long time in:

./ruby -rpurelib.rb ./bin/rdoc --all --ri --op .ext/rdoc .

Maybe it would be great to disable RDOC generation from the beggining for make the install process faster... What do you think?

Let gem_package recognize multiple environments

Setting @node[:rvm][:gem_package][:rvm_string] = 'system,ruby-1.9.2' will allow gem_package to install to two environments simultaneously. However, it breaks the detection of environments that allows this to be idempotent.

[Wed, 15 Jun 2011 00:00:46 +0000] INFO: Installing gem_package[rack-throttle] version 0.3.0
[Wed, 15 Jun 2011 00:00:46 +0000] WARN: rvm_environment[system,ruby-1.9.2] is either not fully qualified or not known . Use rvm list known to get a full list.

Chef::Provider::Package::RVMRubygems::AlternateGemEnvironment

I am attempting to use this recipe in rightscale which uses chef 0.8.16.8. I am getting this error at convergence:

*ERROR> An error occurred during the execution of Chef. The error message was:

uninitialized constant Chef::Provider::Package::RVMRubygems::AlternateGemEnvironment

Looks like libraries/rvm_rubygems_package.rb is having issues, possibly with such an old version of chef?

failing to install rvm using knife ec2 server create

I've been working on this one for a few hrs and I just hate to file this bug report (you'll see why in a minute).

in summary, using your latest chef-rvm cookbook, and all the latest chef gems, I load up a bare bones instance using:

knife ec2 server create -r "role[webapp_server]" -I ami-3202f25b -G default --ssh-key sweetspot-keypair -f 't1.micro' -x ubuntu

where webapp_server just installs a few basic recipes and then fails at the rvm recipe.

when I run the above command, I get:

ec2-67-202-23-92.compute-1.amazonaws.com [Mon, 16 May 2011 05:55:39 +0000] INFO: template[/etc/rvmrc] updated content
ec2-67-202-23-92.compute-1.amazonaws.com [Mon, 16 May 2011 05:55:39 +0000] INFO: Processing execute[upgrade RVM to none] action run (rvm::system line 65)
ec2-67-202-23-92.compute-1.amazonaws.com [Mon, 16 May 2011 05:55:39 +0000] INFO: Processing rvm_default_ruby[ree-1.8.7-2011.03] action create (rvm::default line 41)
ec2-67-202-23-92.compute-1.amazonaws.com [Mon, 16 May 2011 05:55:56 +0000] ERROR: rvm_default_ruby[ree-1.8.7-2011.03] (rvm::default line 41) has had an error
ec2-67-202-23-92.compute-1.amazonaws.com [Mon, 16 May 2011 05:55:56 +0000] ERROR: Running exception handlers
ec2-67-202-23-92.compute-1.amazonaws.com [Mon, 16 May 2011 05:55:58 +0000] FATAL: Saving node information to /var/chef/cache/failed-run-data.json
ec2-67-202-23-92.compute-1.amazonaws.com [Mon, 16 May 2011 05:55:58 +0000] ERROR: Exception handlers complete
ec2-67-202-23-92.compute-1.amazonaws.com [Mon, 16 May 2011 05:55:58 +0000] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
ec2-67-202-23-92.compute-1.amazonaws.com [Mon, 16 May 2011 05:55:58 +0000] FATAL: ArgumentError: rvm_default_ruby[ree-1.8.7-2011.03] (rvm::default line 41) had an error: syntax error on line 22, col 0: `if [ ! -f /usr/bin/chef-client ]; then'

if I go in and view the stacktrace log, one sees:

ubuntu@domU-12-31-39-07-68-19:~$ less /var/chef/cache/chef-stacktrace.out

Generated at Mon May 16 05:55:58 +0000 2011
ArgumentError: rvm_default_ruby[ree-1.8.7-2011.03] (rvm::default line 41) had an error: syntax error on line 22, col 0: `if [ ! -f /usr/bin/chef-client ]; then'
/usr/lib/ruby/1.8/yaml.rb:133:in `load'
/usr/lib/ruby/1.8/yaml.rb:133:in `load'
/usr/lib/ruby/gems/1.8/gems/rvm-1.6.9/lib/rvm/shell/abstract_wrapper.rb:139:in `raw_stdout_to_parts'
/usr/lib/ruby/gems/1.8/gems/rvm-1.6.9/lib/rvm/shell/single_shot_wrapper.rb:21:in `run_command'
/usr/lib/ruby/gems/1.8/gems/rvm-1.6.9/lib/rvm/shell/single_shot_wrapper.rb:44:in `with_shell_instance'
/usr/lib/ruby/gems/1.8/gems/rvm-1.6.9/lib/rvm/shell/single_shot_wrapper.rb:17:in `run_command'
/usr/lib/ruby/gems/1.8/gems/rvm-1.6.9/lib/rvm/shell/abstract_wrapper.rb:71:in `run'
/usr/lib/ruby/gems/1.8/gems/rvm-1.6.9/lib/rvm/environment/utility.rb:67:in `rvm'
/usr/lib/ruby/gems/1.8/gems/rvm-1.6.9/lib/rvm/environment/list.rb:38:in `list_known_strings'
/usr/lib/ruby/gems/1.8/gems/rvm-1.6.9/lib/rvm.rb:152:in `__send__'
/usr/lib/ruby/gems/1.8/gems/rvm-1.6.9/lib/rvm.rb:152:in `method_missing'
/var/chef/cache/cookbooks/rvm/libraries/helpers.rb:114:in `update_known_rubies'
/var/chef/cache/cookbooks/rvm/libraries/helpers.rb:106:in `known_rubies'
/var/chef/cache/cookbooks/rvm/libraries/helpers.rb:86:in `ruby_known?'
/var/chef/cache/cookbooks/rvm/libraries/helpers.rb:124:in `ruby_unknown?'
/var/chef/cache/cookbooks/rvm/providers/default_ruby.rb:28:in `class_from_file'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/provider.rb:104:in `instance_eval'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/provider.rb:104:in `action_create'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/resource.rb:417:in `send'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/resource.rb:417:in `run_action'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/runner.rb:45:in `run_action'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/runner.rb:78:in `converge'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/runner.rb:78:in `each'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/runner.rb:78:in `converge'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/resource_collection.rb:94
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/resource_collection.rb:92:in `execute_each_resource'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/runner.rb:76:in `converge'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/client.rb:312:in `converge'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/client.rb:160:in `run'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/application/client.rb:239:in `run_application'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/application/client.rb:229:in `loop'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/application/client.rb:229:in `run_application'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/application.rb:66:in `run'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/chef-client:26
/usr/bin/chef-client:19:in `load'
/usr/bin/chef-client:19

tracing through this code, it looks like it is failing deep within RVM, which is trying to YAML.load output which includes all the text from this file:

https://github.com/opscode/chef/blob/master/chef/lib/chef/knife/bootstrap/ubuntu10.04-gems.erb

If I go in and manually run chef-client, it doesn't fail here (it fails because of another outstanding issue which regressed from rvm 1.6.5).

so huh!! I'm not sure what the best path is. I'm very tempted to go through and provide a patch for your helpers.rb that removes all the calls to RVM.*, like RVM.list_known_strings (which is where this specific error is occuring) with something like
rvm list known_strings.strip.split.sort

I have run into issues with RVM (and bundler) before, and that was a tough one to figure out and patch, so I'm a bit loath to touch that code base again! ;) Any thoughts?

thanks!

Cannot edit default.gems, no versions in global.gems

Currently, there's no mechanism (that I can find) in chef-rvm for automatically writing to your default.gems, and the mechanism for global.gems appears flawed. default.gems appears to be getting generated as the rvm defaults (which can wind up installing the wrong versions of rake and bundler), and global.gems is getting generated additively, so it contains the rvm defaults plus anything we've called with rvm_global_gem. Again, my use case is that I want specific, slightly old versions of bundler and rake, while rvm defaults to installing the newest ones.

Also, the entries added to global.gems don't include version number strings or source locations.

I'm currently reworking this for my purposes with templates instead, will pull request once I've got it working well if you're amenable.

node.rvm.upgrade = nil

Currently the documentation regarding the :upgrade option says "none" is for no upgrades.

In the spirit of using false and nil, the option for no upgrades should be nil with, optionally, false and "none" also supported.

rvm_gem resource fails to load RVM environment on initial pass

This is summarized by @yfeldblum in a comment for #14. The change was added to close #10 but clearly is not totally correct yet.

A copy of the comment text is included:


Additionally, once I do the above and have RVM installed and RVM rubies installed but no default RVM ruby (instead continuing to use system ruby as the default)....

When I follow up and do

rvm_gem "whatever" do
  ruby_string "ruby-1.9.2-p180" # that's one of the already-installed RVM rubies
end

then, in the same initial run of the my cookbook (which makes use of your RVM cookbook), I get

ERROR: rvm_gem[whatever] (/srv/chef/cache/cookbooks/myfuncookbook/recipes/myfunrecipe.rb:1:in `from_file') had an error:
Expected process to exit 0, but it exited with 127
---- Begin output of bash -c "source /etc/profile.d/rvm.sh" && rvm ruby-1.9.2-p180 gem env gempath ----
STDOUT: 
STDERR: sh: rvm: not found
---- End output of bash -c "source /etc/profile.d/rvm.sh" && rvm ruby-1.9.2-p180 gem env gempath ----
Ran bash -c "source /etc/profile.d/rvm.sh" && rvm ruby-1.9.2-p180 gem env gempath returned 127
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/shell_out.rb:232:in `invalid!'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/shell_out.rb:218:in `error!'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/mixin/shell_out.rb:33:in `shell_out!'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/provider/package/rubygems.rb:237:in `gem_paths'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/provider/package/rubygems.rb:245:in `gem_source_index'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/provider/package/rubygems.rb:76:in `installed_versions'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/provider/package/rubygems.rb:346:in `matching_installed_versions'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/provider/package/rubygems.rb:329:in `current_version'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/provider/package/rubygems.rb:362:in `load_current_resource'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/resource.rb:394:in `run_action'
/srv/chef/cache/cookbooks/rvm/providers/gem.rb:109:in `gem_package_wrapper'
/srv/chef/cache/cookbooks/rvm/providers/gem.rb:40:in `class_from_file'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/provider.rb:104:in `instance_eval'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/provider.rb:104:in `action_install'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/resource.rb:395:in `send'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/resource.rb:395:in `run_action'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/runner.rb:53:in `run_action'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/runner.rb:89:in `converge'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/runner.rb:89:in `each'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/runner.rb:89:in `converge'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/resource_collection.rb:94
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/resource_collection.rb:92:in `execute_each_resource'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/runner.rb:84:in `converge'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/client.rb:268:in `converge'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/client.rb:171:in `run'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/application/client.rb:222:in `run_application'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/application/client.rb:212:in `loop'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/application/client.rb:212:in `run_application'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/application.rb:62:in `run'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/chef-client:26
/usr/bin/chef-client:19:in `load'
/usr/bin/chef-client:19

But on the second attempt to run the cookbook, the "rvm_gem[whatever]" resource succeeds (instead of failing with the above backtrace) as expected.

Using = instead of ==


/Users/bradphelan/workspace/mysugr/mysugrapp/vendor/cookbooks/rvm/libraries/rvm_rubygems_package.rb

123 def install_package(name, version)
124 # ensure each ruby is installed and gemset exists
125 ruby_strings.each do |rubie|
126 next if rubie = 'system'
127 e = rvm_environment rubie do
128 user new_resource.user if new_user.respond_to?("user")
129 action :nothing

line 126 should be

if rubie == 'system'

Add versioning and CHANGELOG

Since others are starting to play with this cookbook, then I want to be more careful with introducing any sweeping changes.

  • Let's start to treat the cookbook like a ruby gem and update the version metadata field (possibly also tagging?)
  • Add a changelog to track high level features and changes

rvm & Vagrant : NoMethodError: undefined method `keys' for []:Array

I'm eventually trying to set up a vagrant box to be used as a dev workstation. I'm new to vagrant & chef but not new to linux or rvm.
For the moment I'd just be happy to get a vagrant box running with rvm. I think I've got rvm configured the way I want in my Vagrantfile, but running it produces the above error. I'm fairly sure this is a user error, I haven't understood or configured something correctly but digging into the code that produced the stacktrace hasn't produced anything useful for me.
I've gisted my Vagrantfile & the full stacktrace that chef-solo produces.
https://gist.github.com/564d59022cf4347fb85b

homedir for rvm user

For setting up user rvm, it seems that by default your cookbook looks for the user's homedir to be in /home. What is the option/attribute I need to set to specify this explicitly?

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.