title: Installing ruby 1.9.3 on vagrant rbenv NoMethodError loaded_recipe?
body: <p>i am attempting an vagrant install and would like to have <code>1.9.3-p327</code> as the default ruby version. i am using chef-solo and librarian-chef to manage the vagrant machine. </p>
  
  <p>my vagrant file provisioning for chef-solo looks like this</p>
  
  <pre><code>config.vm.provision :chef_solo do |chef|
  chef.cookbooks_path = "cookbooks"
  chef.add_recipe "apt"
  chef.add_recipe "build-essential"
  chef.add_recipe "git"
  chef.add_recipe "ruby_build"
  chef.add_recipe "rbenv::system"
  chef.add_recipe "rbenv::vagrant"
  chef.add_recipe "sqlite"
  chef.add_recipe "nodejs"
  chef.add_recipe "mysql"
  chef.add_recipe "redisio"
  chef.add_recipe "redisio::install"
  chef.add_recipe "redisio::redis_gem"
  chef.add_recipe "zlib"
  chef.add_recipe "wkhtmltopdf"
  
  chef.json = { 
    "rbenv" =&gt; {
      "rubies" =&gt; [ "1.9.3-p327" ],
      "global" =&gt; "1.9.3-p327",
      "gems" =&gt; {
        "1.9.3-p327" =&gt; [
          { "name" =&gt; "bundler" }
        ]
      }
    }
  }
  end
  </code></pre>
  
  <p>and the cheffile that librarian-cheff looks for looks like this</p>
  
  <pre><code>site 'http://community.opscode.com/api/v1'
  
  cookbook 'apt'
  cookbook 'git'
  cookbook 'build-essential'
  cookbook 'rbenv',
    git: 'https://github.com/fnichol/chef-rbenv.git'
  cookbook 'ruby_build'
  cookbook 'sqlite',
    git: 'git://github.com/opscode-cookbooks/sqlite.git'
  cookbook 'nodejs',
    git: 'http://github.com/mdxp/nodejs-cookbook'
  cookbook 'mysql',
    git: 'git://github.com/opscode-cookbooks/mysql.git'
  cookbook 'redisio',
    git: 'git://github.com/brianbianco/redisio.git'
  cookbook 'zlib',
    git: 'git://github.com/opscode-cookbooks/zlib'
  cookbook 'wkhtmltopdf',
    git: 'git://github.com/firstbanco/chef-wkhtmltopdf.git'
  </code></pre>
  
  <p>and from these two i should be able to run the vagrant file unfortunately it looks as if where i am specifying the version of ruby to chef-solo is bombing out. it was working yesterday afternoon which leads me to think that someone has updated a cookbook between then and now. so when i called librarian-chef install it pulled it and has freaked out.. </p>
  
  <pre><code>================================================================================
  Error executing action `install` on resource 'rbenv_ruby[1.9.3-p327] (system)'
  ================================================================================
  
  NoMethodError
  -------------
  undefined method `loaded_recipe?' for #&lt;Chef::RunContext:0x7f34cf773ed0&gt;
  
  Cookbook Trace:
  ---------------
  
  /tmp/vagrant-chef-1/chef-solo-1/cookbooks/rbenv/providers/ruby.rb:88:in `ruby_build_missing?'
  /tmp/vagrant-chef-1/chef-solo-1/cookbooks/rbenv/providers/ruby.rb:43:in `perform_install'
  /tmp/vagrant-chef-1/chef-solo-1/cookbooks/rbenv/providers/ruby.rb:33:in `class_from_file'
  
  Resource Declaration:
  ---------------------
  # In /tmp/vagrant-chef-1/chef-solo-1/cookbooks/rbenv/recipes/system.rb
  
   27:   else
   28:     rbenv_ruby rubie
   29:   end
  
   Compiled Resource: 
  ------------------
  # Declared in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/rbenv/recipes/system.rb:28:in `from_file'
  
  rbenv_ruby("1.9.3-p327") do
    retry_delay 2
    retries 0
    recipe_name "system"
    definition "1.9.3-p327"
    action :install
    cookbook_name :rbenv
  end
  
  [2013-05-31T09:55:55+00:00] ERROR: Running exception handlers
  [2013-05-31T09:55:55+00:00] ERROR: Exception handlers complete
  [2013-05-31T09:55:55+00:00] FATAL: Stacktrace dumped to /tmp/vagrant-chef-1/chef-stacktrace.out
  [2013-05-31T09:55:55+00:00] FATAL: NoMethodError: rbenv_ruby[1.9.3-p327] (system) (rbenv::system line 28) had an error: NoMethodError: undefined method `loaded_recipe?' for #&lt;Chef::RunContext:0x7f34cf773ed0&gt;
  Chef never successfully completed! Any errors should be visible in the
  output above. Please fix your recipes so that they properly complete.
  </code></pre>
  
  <p>if i comment out the json that specifies the ruby version then it works. it seems as if ill have to specify versions of rbenv but what are trusted versions and where can i find them.</p>
  
  <p><b>Edit:</b> you will also have to specify the user details in the json. since your installing to system and user(vagrant) levels. and chef is using the ruby that the vagrant box provides. here is what my updated ruby version for rbenv json looks like.</p>
  
  <pre><code>chef.json = {
    'rbenv' =&gt; {
      'user_installs' =&gt; [
        {
          'user'    =&gt; 'vagrant',
          'rubies'  =&gt; ['1.9.3-p327'],
          'global'  =&gt; '1.9.3-p327',
          'gems'    =&gt; {
            '1.9.3-p327' =&gt; [
              { 'name'    =&gt; 'bundler' },
              { 'name'    =&gt; 'rake' }
            ]
          }
        }
      ]
    },
  </code></pre>