Skip to content

Instantly share code, notes, and snippets.

@kouno
Created September 23, 2012 05:52
Show Gist options
  • Save kouno/3769022 to your computer and use it in GitHub Desktop.
Save kouno/3769022 to your computer and use it in GitHub Desktop.
Chef command `execute` fail to enter ENV variables
# Install Gems with bundle install
execute "gitlab-bundle-install" do
command "bundle install"
cwd node['gitlab']['app_home']
user node['gitlab']['user']
group node['gitlab']['group']
end
===============
Error message
===============
================================================================================
Error executing action `run` on resource 'execute[gitlab-bundle-install]'
================================================================================
Errno::ENOENT
-------------
No such file or directory - bundle install
Resource Declaration:
---------------------
# In /tmp/vagrant-chef-1/chef-solo-2/cookbooks/gitlab/recipes/vagrant.rb
228: # Install Gems with bundle install
229: execute "gitlab-bundle-install" do
230: command "bundle install"
231: cwd node['gitlab']['app_home']
232: user node['gitlab']['user']
233: group node['gitlab']['group']
234: end
Compiled Resource:
------------------
# Declared in /tmp/vagrant-chef-1/chef-solo-2/cookbooks/gitlab/recipes/vagrant.rb:229:in `from_file'
execute("gitlab-bundle-install") do
cwd "/vagrant"
retry_delay 2
cookbook_name :gitlab
user "vagrant"
retries 0
action "run"
returns 0
command "bundle install"
recipe_name "vagrant"
group "vagrant"
backup 5
end
[2012-09-23T07:49:33+02:00] ERROR: Running exception handlers
[2012-09-23T07:49:33+02:00] ERROR: Exception handlers complete
[2012-09-23T07:49:33+02:00] FATAL: Stacktrace dumped to /tmp/vagrant-chef-1/chef-stacktrace.out
[2012-09-23T07:49:33+02:00] FATAL: Errno::ENOENT: execute[gitlab-bundle-install] (gitlab::vagrant line 229) had an error: Errno::ENOENT: No such file or directory - bundle install
===========
Doing it myself works perfectly:
vagrant@lucid32:~$ cd /vagrant/
vagrant@lucid32:/vagrant$ bundle install
Using rake (0.9.2.2)
Using i18n (0.6.1)
Using multi_json (1.3.6)
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment