Skip to content
This repository has been archived by the owner on Dec 26, 2017. It is now read-only.

On Mac OS 10.10 'can't find gem berkshelf (>= 0.a)' #315

Open
valentinbud opened this issue Feb 6, 2017 · 6 comments
Open

On Mac OS 10.10 'can't find gem berkshelf (>= 0.a)' #315

valentinbud opened this issue Feb 6, 2017 · 6 comments

Comments

@valentinbud
Copy link

Dear community,

I have the following environment:

Mac OS X 10.10.5.

Vagrant installed from https://www.vagrantup.com/downloads.html.

$ vagrant version
Ignoring ffi-yajl-2.3.0 because its extensions are not built.  Try: gem pristine ffi-yajl --version 2.3.0
Ignoring libyajl2-1.2.0 because its extensions are not built.  Try: gem pristine libyajl2 --version 1.2.0
Installed Version: 1.9.1
Latest Version: 1.9.1

You're running an up-to-date version of Vagrant!

Chef Development Kit installed from https://downloads.chef.io/chefdk.

$ chef --version
Chef Development Kit Version: 1.2.22
chef-client version: 12.18.31
delivery version: master (0b746cafed65a9ea1a79de3cc546e7922de9187c)
berks version: 2017-02-06T12:15:40.030098 59350] 2017-02-06T12:15:40.031381 59350] 2017-02-06T12:15:40.031555 59350] 2017-02-06T12:15:40.031689 59350] 2017-02-06T12:15:40.066028 59350] 2017-02-06T12:15:40.066165 59350] 5.6.0
kitchen version: 1.15.0

And berks is found at proper location. I have appended /opt/chefdk/embedded/bin to $PATH.

$ which berks
/opt/chefdk/embedded/bin/berks

At vagrant up I receive the following error:

$ vagrant up
Ignoring ffi-yajl-2.3.0 because its extensions are not built.  Try: gem pristine ffi-yajl --version 2.3.0
Ignoring libyajl2-1.2.0 because its extensions are not built.  Try: gem pristine libyajl2 --version 1.2.0
Bringing machine 'default' up with 'virtualbox' provider...
The following berks command failed to execute:

    /opt/chefdk/embedded/bin/berks --version --format json

The stdout and stderr are shown below:

    stdout:
    stderr: Ignoring ffi-1.9.14 because its extensions are not built.  Try: gem pristine ffi --version 1.9.14
Ignoring nokogiri-1.6.7.1 because its extensions are not built.  Try: gem pristine nokogiri --version 1.6.7.1
Ignoring unf_ext-0.0.7.2 because its extensions are not built.  Try: gem pristine unf_ext --version 0.0.7.2
Ignoring wdm-0.1.1 because its extensions are not built.  Try: gem pristine wdm --version 0.1.1
/opt/chefdk/embedded/lib/ruby/site_ruby/2.3.0/rubygems.rb:270:in `find_spec_for_exe': can't find gem berkshelf (>= 0.a) (Gem::GemNotFoundException)
	from /opt/chefdk/embedded/lib/ruby/site_ruby/2.3.0/rubygems.rb:298:in `activate_bin_path'
	from /opt/chefdk/embedded/bin/berks:22:in `<main>'

A few things I have noticed. Using chefdk's gem command I found out that wdm gem is not installed and others are at different versions.

$ /opt/chefdk/embedded/bin/gem list | grep wdm

$ /opt/chefdk/embedded/bin/gem list | grep nokogiri
nokogiri (1.6.8.1)

Note the version from Ignoring warning is different, 1.6.7.1.

The same with ffi (1.9.14).

$ /opt/chefdk/embedded/bin/gem list | grep ffi
ffi (1.9.17)

I don't know if that has anything to do with the error but I thought it's worth mentioning.

@valentinbud valentinbud changed the title On Mac OS 10.10 'can't find gem berkshelf (>= 0.a)' [SOLVED] On Mac OS 10.10 'can't find gem berkshelf (>= 0.a)' Feb 6, 2017
@valentinbud
Copy link
Author

valentinbud commented Feb 6, 2017

I have fixed it using @sethvargo's advice from #256. Completely remove vagrant and ~/.vagrant.d and reinstall.

@valentinbud valentinbud changed the title [SOLVED] On Mac OS 10.10 'can't find gem berkshelf (>= 0.a)' On Mac OS 10.10 'can't find gem berkshelf (>= 0.a)' Feb 6, 2017
@valentinbud valentinbud reopened this Feb 6, 2017
@valentinbud
Copy link
Author

I have talked to soon.

It still doesn't work. Same error. This time I have installed latest vagrant with brew cask install vagrant.

$ vagrant up
Ignoring ffi-yajl-2.3.0 because its extensions are not built.  Try: gem pristine ffi-yajl --version 2.3.0
Ignoring libyajl2-1.2.0 because its extensions are not built.  Try: gem pristine libyajl2 --version 1.2.0
Bringing machine 'default' up with 'virtualbox' provider...
The following berks command failed to execute:

    /opt/chefdk/embedded/bin/berks --version --format json

The stdout and stderr are shown below:

    stdout:
    stderr: Ignoring ffi-1.9.14 because its extensions are not built.  Try: gem pristine ffi --version 1.9.14
Ignoring nokogiri-1.6.7.1 because its extensions are not built.  Try: gem pristine nokogiri --version 1.6.7.1
Ignoring unf_ext-0.0.7.2 because its extensions are not built.  Try: gem pristine unf_ext --version 0.0.7.2
Ignoring wdm-0.1.1 because its extensions are not built.  Try: gem pristine wdm --version 0.1.1
/opt/chefdk/embedded/lib/ruby/site_ruby/2.3.0/rubygems.rb:270:in `find_spec_for_exe': can't find gem berkshelf (>= 0.a) (Gem::GemNotFoundException)
        from /opt/chefdk/embedded/lib/ruby/site_ruby/2.3.0/rubygems.rb:298:in `activate_bin_path'
        from /opt/chefdk/embedded/bin/berks:22:in `<main>'

Can someone shed some light please :). Thank you.

@whusted
Copy link

whusted commented Mar 21, 2017

@valentinbud any update on this? I'm having 1 for 1 the exact same issue

@malaskowski
Copy link

Hi,
I have the same issue running Vagrant 1.9.2 on Windows 10. I have chefdk 1.1.16 installed.
Any ideas how to fix it?

I've already tried re-installing Vagrant and downgrading to 1.9.1 version. Result is the same every time:

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
The following berks command failed to execute:

    C:\opscode\chefdk\embedded\bin/berks.BAT --version --format json

The stdout and stderr are shown below:

    stdout:
    stderr: Ignoring wdm-0.1.1 because its extensions are not built.  Try: gem pristine wdm --version 0.1.1
C:/opscode/chefdk/embedded/lib/ruby/site_ruby/2.3.0/rubygems.rb:270:in `find_spec_for_exe': can't find gem berkshelf (>= 0.a) (Gem::GemNotFoundException)
        from C:/opscode/chefdk/embedded/lib/ruby/site_ruby/2.3.0/rubygems.rb:298:in `activate_bin_path'
        from C:/opscode/chefdk/embedded/bin/berks:22:in `<main>'

@ilude
Copy link

ilude commented Apr 26, 2017

I fixed this on mac OS by placing /opt/chefdk/bin before everything else in the PATH.

@joseenriquevasquez
Copy link

I was getting this
stderr: /opt/chef/embedded/lib/ruby/2.4.0/rubygems.rb:270:in find_spec_for_exe': can't find gem berkshelf (>= 0.a) (Gem::GemNotFoundException)
`
I changed the PATH according to ilude and works now

spajus added a commit to spajus/vagrant-berkshelf-nochefdk that referenced this issue Nov 9, 2017
Motivation: not everyone who are trying to run Vagrant with Chef
provisioning prefer to have the bulky installation of ChefDK, and
berksfile gem simply works.

Judging by the amount of issues complaining about being unable to locate
berksfile gem, this is often a problem:
berkshelf#318
berkshelf#315
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants