schubergphilis / vagrant-chef-zero

Vagrant Plugin for Chef Zero
Apache License 2.0
91 stars 41 forks source link

Can't install the plugin with Vagrant 2.0.1 #77

Open gavvvr opened 7 years ago

gavvvr commented 7 years ago

Looks like there is a trouble with building native extensions for ffi-yajl-1.4.0. I do not know who depends on it, but I face the problem installing vagrant-chef-zero plugin. I have a Mac with Vagrant 2.0.1 installed and latest chefDk:

Chef Development Kit Version: 2.3.4
chef-client version: 13.4.19
delivery version: master (73ebb72a6c42b3d2ff5370c476be800fee7e5427)
berks version: 6.3.1
kitchen version: 1.17.0
inspec version: 1.36.1
vagrant plugin install vagrant-chef-zero                                                                                                                                   
Installing the 'vagrant-chef-zero' plugin. This can take a few minutes...                                                                                                                                   
Fetching: vagrant-share-1.1.9.gem (100%)                                                                                                                                                                    
Fetching: mixlib-log-1.7.1.gem (100%)                                                                                                                                                                       
Fetching: hashie-2.1.2.gem (100%)                                                                                                                                                                           
Fetching: libyajl2-1.2.0.gem (100%)                                                                                                                                                                         
Building native extensions.  This could take a while...                                                                                                                                                     
Fetching: ffi-yajl-1.4.0.gem (100%)                                                                                                                                                                         
Building native extensions.  This could take a while...                                                                                                                                                     
Bundler, the underlying system Vagrant uses to install plugins,                                                                                                                                             
reported an error. The error is shown below. These errors are usually                                                                                                                                       
caused by misconfigured plugin installations or transient network                                                                                                                                           
issues. The error from Bundler is:

ERROR: Failed to build gem native extension.

    current directory: /Users/user/.vagrant.d/gems/2.4.2/gems/ffi-yajl-1.4.0/ext/ffi_yajl/ext/encoder
/opt/vagrant/embedded/bin/ruby -r ./siteconf20171108-6740-csrr4x.rb extconf.rb
 -I/Users/user/.vagrant.d/gems/2.4.2/gems/libyajl2-1.2.0/lib/libyajl2/vendored-libyajl2/include -I/opt/vagrant/embedded/include -I/vagrant-substrate/cache/ruby-2.4.2/include -O3 -fno-common -pipe
 -L/Users/user/.vagrant.d/gems/2.4.2/gems/libyajl2-1.2.0/lib/libyajl2/vendored-libyajl2/lib -L. -L/opt/vagrant/embedded/lib  -Wl,-rpath,@loader_path/../lib -Wl,-rpath,@executable_path/../lib -Wl,-rpath,/$pt/vagrant/embedded/lib -fstack-protector -L/usr/local/lib -L/opt/vagrant/embedded/lib
checking for yajl/yajl_tree.h... yes
creating Makefile

current directory: /Users/user/.vagrant.d/gems/2.4.2/gems/ffi-yajl-1.4.0/ext/ffi_yajl/ext/encoder
make "DESTDIR=" clean

current directory: /Users/user/.vagrant.d/gems/2.4.2/gems/ffi-yajl-1.4.0/ext/ffi_yajl/ext/encoder
make "DESTDIR="
compiling encoder.c
encoder.c:382:20: error: use of undeclared identifier 'rb_cFixnum'
  rb_define_method(rb_cFixnum, "ffi_yajl", rb_cFixnum_ffi_yajl, 2);
                   ^
encoder.c:383:20: error: use of undeclared identifier 'rb_cBignum'
  rb_define_method(rb_cBignum, "ffi_yajl", rb_cBignum_ffi_yajl, 2);
                   ^
2 errors generated.
make: *** [encoder.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/user/.vagrant.d/gems/2.4.2/gems/ffi-yajl-1.4.0 for inspection.
Results logged to /Users/user/.vagrant.d/gems/2.4.2/extensions/x86_64-darwin-13/2.4.0/ffi-yajl-1.4.0/gem_make.out
sandeephello commented 6 years ago

I am also seeing the similar errors.

gavvvr commented 6 years ago

@sandeephello It is probably not required. Because for me Chef provisioner actually works without vagrant plugin install vagrant-chef-zero

zavan commented 4 years ago

I have forked the repo and updated the vagrant and chef-zero dependencies, I only tested it with ruby 2.3.8, vagrant 2.0.4, and chef-zero 2.1 and it seems to work.

To get my fork installed while the PR (#78) isn't merged and released:

git clone https://github.com/Spillover-Software-Group/vagrant-chef-zero
cd vagrant-chef-zero
gem install
rake build
vagrant plugin uninstall vagrant-chef-zero
vagrant plugin install pkg/vagrant-chef-zero-{version}.gem