HewlettPackard / chef-provisioning-oneview

Chef Provisioning Driver for HPE OneView
Other
21 stars 16 forks source link

ERROR: private method `include' called for Chef::Resource::Machine:Class #44

Closed thebsdbox closed 8 years ago

thebsdbox commented 8 years ago

I've redeployed Chef / all of the gem deployment pieces three times, and I always get the same set of errors:

Generated at 2016-03-15 16:34:28 +0000 NoMethodError: private methodinclude' called for Chef::Resource::Machine:Class /home/chef/.gem/ruby/gems/cheffish-2.0.2/lib/cheffish.rb:117:in node_attributes' /home/chef/.gem/ruby/gems/chef-provisioning-1.6.0/lib/chef/resource/machine.rb:31:inclass:Machine' /home/chef/.gem/ruby/gems/chef-provisioning-1.6.0/lib/chef/resource/machine.rb:8:in <class:Resource>'

Does anyone have an idea what may be causing this error, It's clearly something with

require 'chef/provisioning'

jsmartt commented 8 years ago

@thebsdbox , what Ruby version are you running? And where did this fail in the process?

Also, what OS & version are you running? I can try to reproduce the error.

thebsdbox commented 8 years ago

Thanks @jsmartt

Here is the version output..

[root@ovd-chef ~]# ruby -v
ruby 2.0.0p598 (2014-11-13) [x86_64-linux]
[root@ovd-chef ~]# cat /etc/redhat-release 
CentOS Linux release 7.2.1511 (Core) 
[root@ovd-chef ~]# chef-client -v
Chef: 12.8.1
[root@ovd-chef ~]# gem -v
2.0.14
[root@ovd-chef ~]# gem list

*** LOCAL GEMS ***

bigdecimal (1.2.0)
io-console (0.4.2)
json (1.7.7)
psych (2.0.0)
rdoc (4.0.0)
[root@ovd-chef ~]# 

Alternatively can you let me know what your base versions are and I can just recreate a matching environment.

Thanks,

-Dan

jsmartt commented 8 years ago

@thebsdbox, the only thing that I'd be concerned with is the ruby version. I just brought up a box to try to duplicate it, but chef and chefdk both install ruby 2.1.6. Would you be able to upgrade that and give it another try?

thebsdbox commented 8 years ago

So ... the fix for using ruby and OneView provisioning on CentOS 7.x is as follows:

yum remove ruby ruby-devel

yum groupinstall -y 'development tools'

command curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -

curl -L get.rvm.io | bash -s stable

source /etc/profile.d/rvm.sh

rvm reload

rvm install 2.2

curl -L https://www.opscode.com/chef/install.sh | bash

gem install 'chef-provisioning-oneview'

It's now almost working .. :-)

jsmartt commented 8 years ago

@thebsdbox , thanks for the update. Added this to the Troubleshooting Wiki

How are you running the recipe?

Chef comes with it's own version of ruby, so I'm surprised that upgrading your system ruby fixed it unless it was never using the Chef ruby in the first place.

I imagine this is my fault, because the installation instructions in the readme show how to install it on the system ruby, which is more for development. This really needs to be updated to install using a chef recipe with:

chef_gem 'chef-provisioning-oneview'

To be clear, to use the driver you don't need a separate system ruby; just the ruby that comes with the chef-client or ChefDK. I put up PR #45 to address this.

thebsdbox commented 8 years ago

Looks good, thanks.

I've everything running smoothly now.