Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

knife ec2 server create --bootstrap does not install gems. #238

Closed
gyoza opened this issue Sep 18, 2014 · 4 comments
Closed

knife ec2 server create --bootstrap does not install gems. #238

gyoza opened this issue Sep 18, 2014 · 4 comments

Comments

@gyoza
Copy link

gyoza commented Sep 18, 2014

I've been trying to figure out why a "knife ec2 server create --bootstrap" does not install the required gems to allow embedded chef to run.

This is happening on 11.12.8 and 11.16.0

Interestingly enough a "knife bootstrap" installs all the required gems. Can anybody help point me in the right direction at resolving this weird issue?

Gem list from "knife ec2 server create --bootstrap"

*** LOCAL GEMS ***

bigdecimal (1.2.0)
json (1.7.7)
psych (2.0.0)
rdoc (4.0.1)

Gem list from "knife bootstrap"

*** LOCAL GEMS ***

bigdecimal (1.2.5, 1.2.0)
chef (11.12.8)
chef-zero (2.0.2)
coderay (1.1.0)
diff-lcs (1.2.5)
erubis (2.7.0)
ffi (1.9.3)
ffi-yajl (1.1.0)
hashie (2.1.2)
highline (1.6.21)
ipaddress (0.8.0)
json (1.8.1, 1.7.7)
libyajl2 (1.0.1)
method_source (0.8.2)
mime-types (2.3, 1.25.1)
mixlib-authentication (1.3.0)
mixlib-cli (1.5.0)
mixlib-config (2.1.0)
mixlib-log (1.6.0)
mixlib-shellout (1.4.0)
net-ssh (2.9.1)
net-ssh-gateway (1.2.0)
net-ssh-multi (1.2.0)
ohai (7.4.0, 7.0.4)
pry (0.10.1)
psych (2.0.6, 2.0.0)
rack (1.5.2)
rdoc (4.1.2, 4.0.1)
rest-client (1.6.8)
rubygems-update (2.4.1)
slop (3.6.0)
systemu (2.6.4, 2.5.2)
wmi-lite (1.0.0)
yajl-ruby (1.2.1)

pleassse help. Thanks.

@gyoza
Copy link
Author

gyoza commented Sep 18, 2014

This is what i get when i try to run the embedded chef client using a knife ec2 server create bootstrap.

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.0/bin/chef-client --help
/usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- mixlib/shellout/exceptions (LoadError)
    from /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.0/lib/chef/exceptions.rb:27:in `<class:Exceptions>'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.0/lib/chef/exceptions.rb:24:in `<class:Chef>'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.0/lib/chef/exceptions.rb:20:in `<top (required)>'
    from /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.0/lib/chef.rb:22:in `<top (required)>'
    from /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.0/bin/chef-client:23:in `<main>'

My question remains, why would a knife bootstrap allow the above command to work but the knife ec2 does not? What is going on differently?

@juliandunn
Copy link
Contributor

What OS is this? How come you're running chef-client via the long path? Is the symlink into /usr/bin/chef-client not working?

I'm also mystified by the existence of /usr/share/ruby as the omnibus Chef Client package doesn't create that. Do you already have a Ruby and Rubygems on the system? What is the full path to the gem command you are running?

@gyoza
Copy link
Author

gyoza commented Sep 24, 2014

Hey Julian,

CentOS or Amazon Linux, I've since realized what i was doing wrong. I am still really new to this and I thought in order to run the embedded chef i had to actually execute out of the /opt/chef/embedded directory tree..

For the most part the systems are just amazon linux that gets bootstrapped by knife on the server create so it really shouldn't have any preinstalled gems.. However, noting that I should only be running /usr/bin/chef-client makes things easier.

Sorry to be a pain in the ass :)

I really don't think this is a valid issue anymore.. heh..

@juliandunn
Copy link
Contributor

Haha, ok. I'll close the issue then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants