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

chefdk, vagrant, berkshelf,rbenv mac osx #5388

Closed
ghost opened this issue Feb 25, 2015 · 3 comments
Closed

chefdk, vagrant, berkshelf,rbenv mac osx #5388

ghost opened this issue Feb 25, 2015 · 3 comments

Comments

@ghost
Copy link

ghost commented Feb 25, 2015

hi,

i spent the last 2 days on trying to get the berks plugin to function correctly with vagrant. i can get it to work under linux where i only have the system ruby at 2.2.0 even that took a while in that i couldn't use the berks in my ruby distro, but rather needed to use the berks in the chefdk kit.

now that i'm on my mac, i have same problem but the berks in the chefdk is giving an illegal instruction. however, i have rbenv installed and from googling, this is common, but nobody has an answer to fix it. people mention modifying the PATH, which is what i did, but again berks fails on a segmentation fault. there is definitely some confusion with rbenv and the embedded ruby that comes with chefdk. if somebody could chime in that would be great.

  1. this is with chefdk berks
    => vagrant up
    Bringing machine 'default' up with 'virtualbox' provider...
    The following berks command failed to execute:

/opt/chefdk/bin/berks --version --format json
The stdout and stderr are shown below:

stdout:
stderr:
~/Desktop/projects/vagrant_mean master
=> /opt/chefdk/bin/berks --version --format json
Illegal instruction: 4
[user@SFM1C8F1G3L]
~/Desktop/projects/vagrant_mean master
=> vagrant plugin list
vagrant-berkshelf (4.0.3)
vagrant-omnibus (1.4.1)
vagrant-share (1.1.3)

  1. This is with the rbenv berks which works if you run on the cli, but vagrant seems to believe it fails. it complains the berkshelf is not found, but it is :(

which berks
/Users/user/.rbenv/shims/berks
[user@SFM1C8F1G3L]
~/Desktop/projects/vagrant_mean master
=> vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
The following berks command failed to execute:

/Users/user/.rbenv/shims/berks --version --format json
The stdout and stderr are shown below:

stdout:
stderr: /Users/user/.rbenv/versions/2.2.0/lib/ruby/2.2.0/rubygems/dependency.rb:315:in to_specs': Could not find 'berkshelf' (>= 0) among 51 total gem(s) (Gem::LoadError) Checked in 'GEM_PATH=/Users/user/.vagrant.d/gems:/opt/vagrant/bin/../embedded/gems', execute gem env for more information from /Users/user/.rbenv/versions/2.2.0/lib/ruby/2.2.0/rubygems/dependency.rb:324:in to_spec' from /Users/user/.rbenv/versions/2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_gem.rb:64:ingem' from /Users/user/.rbenv/versions/2.2.0/bin/berks:22:in'

It appears that you are not using the ChefDK. Please note that Vagrant Berkshelf
works best when used with the ChefDK, and other installation methods are not
officially supported.

Please download and install the latest version of the ChefDK from:

https://downloads.chef.io/chef-dk
and follow the installation instructions. Do not forget to add the ChefDK to
your PATH.

[user@SFM1C8F1G3L]
~/Desktop/projects/vagrant_mean master
=> /Users/user/.rbenv/shims/berks --version --format json
{
"version": "3.2.3"
}

~/Desktop/projects/vagrant_mean master
=> gem list

LOCAL GEMS *
addressable (2.3.7)
berkshelf (3.2.3)
berkshelf-api-client (1.2.1)
bigdecimal (1.2.6)
buff-config (1.0.1)

@sethvargo
Copy link
Contributor

Hi @gary-leong-akqa

This looks like an issue with a third-party plugin, vagrant-berkshelf. Please open an issue on that project.

The error about Vagrant shelling out is possibly related to #2476. In general, rbenv creates shims and inserts itself first in the path. This makes shelling out to subprocesses difficult because the environment may change, but the path will remain the same. There are some suggestions on that ticket which might be helpful.

Unfortunately we cannot provide support for third-party plugins on the Vagrant project. Sorry!

@mingderwang
Copy link

yeah, it's fixed when you "vagrant plugin uninstall vagrant-berkshelf".

@github-actions
Copy link

github-actions bot commented Jun 3, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 3, 2021
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

2 participants