Closed ocxo closed 1 year ago
Calling rbenv_execute results in:
rbenv_execute
Recipe: <Dynamically Defined Resource> * execute[eval "$(rbenv init -)"] action run ================================================================================ Error executing action `run` on resource 'execute[eval "$(rbenv init -)"]' ================================================================================ Mixlib::ShellOut::ShellCommandFailed ------------------------------------ Expected process to exit with [0], but received '2' ---- Begin output of eval "$(rbenv init -)" ---- STDOUT: STDERR: sh: 2: /opt/rbenv/libexec/../completions/rbenv.bash: Syntax error: "(" unexpected (expecting "}") ---- End output of eval "$(rbenv init -)" ---- Ran eval "$(rbenv init -)" returned 2 Resource Declaration: --------------------- # In /var/chef/cache/cookbooks/rbenv/providers/execute.rb 21: execute "eval \"$(rbenv init -)\"" do 22: environment new_resource.environment 23: end 24: Compiled Resource: ------------------ # Declared in /var/chef/cache/cookbooks/rbenv/providers/execute.rb:21:in `block in class_from_file' execute("eval "$(rbenv init -)"") do action "run" retries 0 retry_delay 2 command "eval \"$(rbenv init -)\"" backup 5 environment {"PATH"=>"/opt/rbenv/shims:/opt/rbenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "RBENV_ROOT"=>"/opt/rbenv"} returns 0 cookbook_name "scorm-engine" end [2013-10-01T20:48:59+00:00] ERROR: Running exception handlers [2013-10-01T20:48:59+00:00] ERROR: Exception handlers complete [2013-10-01T20:48:59+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out Chef Client failed. 12 resources updated [2013-10-01T20:48:59+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
Verified in 1.6.4 and 1.6.5 on Chef 11.6.0.
This is not a cookbook issue. rbenv init is for interactive shell. See https://github.com/sstephenson/rbenv/issues/454
rbenv init
Calling
rbenv_execute
results in:Verified in 1.6.4 and 1.6.5 on Chef 11.6.0.