fnichol/chef-rbenv — Issue #3: system install precludes user space installs
Author: hedgehog
Created: 2012-02-09 07:41:30+00:00
State: open

A std user should be able to run chef-solo to install a user space rbenv and ruby. However if there is a system rbenv and ruby install in place, the user space rbenv install script seems to get confused:

[Thu, 09 Feb 2012 18:31:05 +1100] INFO: Processing script[rbenv rehash (system)] action run (/home/hedge/personal-chef/cookbooks/rbenv/providers/script.rb line 28)
[Thu, 09 Feb 2012 18:31:05 +1100] INFO: script[rbenv rehash (system)] sh("bash" "/tmp/chef-script20120209-10138-shlfut")
[Thu, 09 Feb 2012 18:31:05 +1100] ERROR: script[rbenv rehash (system)] (/home/hedge/personal-chef/cookbooks/rbenv/providers/script.rb line 28) has had an error
[Thu, 09 Feb 2012 18:31:05 +1100] ERROR: script[rbenv rehash (system)] (/home/hedge/personal-chef/cookbooks/rbenv/providers/script.rb:28:in `block in class_from_file') had an error:
script[rbenv rehash (system)] (/home/hedge/personal-chef/cookbooks/rbenv/providers/script.rb line 28) had an error: Chef::Exceptions::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of "bash" "/tmp/chef-script20120209-10138-shlfut" ----
STDOUT:
STDERR: rbenv: version `global' not installed
rbenv: cannot rehash: /usr/local/rbenv/shims/.rbenv-shim exists
---- End output of "bash" "/tmp/chef-script20120209-10138-shlfut" ----
Ran "bash" "/tmp/chef-script20120209-10138-shlfut" returned 1
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/shell_out.rb:206:in `invalid!'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/shell_out.rb:192:in `error!'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/mixin/shell_out.rb:36:in `shell_out!'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/provider/execute.rb:58:in `action_run'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/provider/script.rb:33:in `action_run'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/resource.rb:440:in `run_action'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/runner.rb:45:in `run_action'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/runner.rb:81:in `block (2 levels) in converge'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/runner.rb:81:in `each'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/runner.rb:81:in `block in converge'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/resource_collection.rb:94:in `block in execute_each_resource'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/resource_collection.rb:92:in `execute_each_resource'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/runner.rb:76:in `converge'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/client.rb:312:in `converge'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/client.rb:160:in `run'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/application/solo.rb:192:in `block in run_application'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/application/solo.rb:183:in `loop'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/application/solo.rb:183:in `run_application'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/application.rb:67:in `run'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/bin/chef-solo:25:in `'
/home/hedge/personal-chef/vendor/ruby/1.9.1/bin/chef-solo:19:in `load'
/home/hedge/personal-chef/vendor/ruby/1.9.1/bin/chef-solo:19:in `

'
[Thu, 09 Feb 2012 18:31:05 +1100] ERROR: Running exception handlers
[Thu, 09 Feb 2012 18:31:05 +1100] ERROR: Exception handlers complete
[Thu, 09 Feb 2012 18:31:05 +1100] FATAL: Stacktrace dumped to /home/hedge/.chef/state/cache/chef-stacktrace.out
[Thu, 09 Feb 2012 18:31:05 +1100] FATAL: Chef::Exceptions::ShellCommandFailed: script[rbenv rehash (system)] (/home/hedge/personal-chef/cookbooks/rbenv/providers/script.rb line 28) had an error: Chef::Exceptions::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of "bash" "/tmp/chef-script20120209-10138-shlfut" ----
STDOUT:
STDERR: rbenv: version `global' not installed
rbenv: cannot rehash: /usr/local/rbenv/shims/.rbenv-shim exists
---- End output of "bash" "/tmp/chef-script20120209-10138-shlfut" ----
Ran "bash" "/tmp/chef-script20120209-10138-shlfut" returned 1