node info:
# cat /etc/redhat-release
CentOS release 6.3 (Final)
# gem list
-bash: gem: command not found
# /opt/chef/embedded/bin/ruby gem list
/opt/chef/embedded/bin/ruby: No such file or directory -- gem (LoadError)
# chef-client -v
Chef: 10.26.0
node info:
# cat /etc/redhat-release
CentOS release 6.3 (Final)
# gem list
-bash: gem: command not found
# /opt/chef/embedded/bin/ruby gem list
/opt/chef/embedded/bin/ruby: No such file or directory -- gem (LoadError)
# chef-client -v
Chef: 10.26.0
Notice the STDERR: sh: gem: command not found error message
chef:recipe > chef_gem "mysql" do
chef:recipe > options ""
chef:recipe ?> end
[2013-06-21T13:20:04-05:00] INFO: Processing chef_gem[mysql] action install ((irb#1) line 20)
================================================================================
Error executing action `install` on resource 'chef_gem[mysql]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '127'
---- Begin output of gem install mysql -q --no-rdoc --no-ri -v "2.9.1" ----
STDOUT:
STDERR: sh: gem: command not found
---- End output of gem install mysql -q --no-rdoc --no-ri -v "2.9.1" ----
A coworker had some ideas.
chef:recipe > chef_gem "mysql" do
chef:recipe > gem_binary("/opt/chef/embedded/bin/gem")
chef:recipe ?> options("-- --with-mysql-lib=/usr/include/mysql")
chef:recipe ?> end
ArgumentError: The chef_gem resource is restricted to the current gem environment, use gem_package to install to other environments.
from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.26.0/lib/chef/resource/chef_gem.rb:37:in `gem_binary'
from (irb#1):2:in `block in irb_binding'
from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.26.0/lib/chef/mixin/recipe_definition_dsl_core.rb:74:in `instance_eval'
from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.26.0/lib/chef/mixin/recipe_definition_dsl_core.rb:74:in `method_missing'
from (irb#1):1
chef:recipe > chef_gem "mysql" do
chef:recipe > options (:build_args => "--with-mysql-lib=/usr/include/mysql")
chef:recipe ?> end
SyntaxError: (irb#1):2: syntax error, unexpected tASSOC, expecting ')'
options (:build_args => "--with-mysql-lib=/usr/include/mysql")
^
(irb#1):2: syntax error, unexpected ')', expecting keyword_end
chef:recipe > chef_gem "mysql"
[2013-06-21T13:17:18-05:00] INFO: Processing chef_gem[mysql] action install ((irb#1) line 1)
================================================================================
Error executing action `install` on resource 'chef_gem[mysql]'
================================================================================
Gem::Installer::ExtensionBuildError
-----------------------------------
ERROR: Failed to build gem native extension.
/opt/chef/embedded/bin/ruby extconf.rb
checking for mysql_ssl_set()... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Notice the STDERR: sh: gem: command not found error message
chef:recipe > chef_gem "mysql" do
chef:recipe > options "-- --with-mysql-lib=/usr/include/mysql"
chef:recipe ?> end
[2013-06-21T13:17:49-05:00] INFO: Processing chef_gem[mysql] action install ((irb#1) line 9)
================================================================================
Error executing action `install` on resource 'chef_gem[mysql]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '127'
---- Begin output of gem install mysql -q --no-rdoc --no-ri -v "2.9.1" -- --with-mysql-lib=/usr/include/mysql ----
STDOUT:
STDERR: sh: gem: command not found
Notice the STDERR: sh: gem: command not found error message
chef:recipe > chef_gem "mysql" do
chef:recipe > options "--with-mysql-lib=/usr/include/mysql"
chef:recipe ?> end
[2013-06-21T13:19:50-05:00] INFO: Processing chef_gem[mysql] action install ((irb#1) line 15)
================================================================================
Error executing action `install` on resource 'chef_gem[mysql]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '127'
---- Begin output of gem install mysql -q --no-rdoc --no-ri -v "2.9.1" --with-mysql-lib=/usr/include/mysql ----
STDOUT:
STDERR: sh: gem: command not found
---- End output of gem install mysql -q --no-rdoc --no-ri -v "2.9.1" --with-mysql-lib=/usr/include/mysql ----
Ran gem install mysql -q --no-rdoc --no-ri -v "2.9.1" --with-mysql-lib=/usr/include/mysql returned 127