-
Notifications
You must be signed in to change notification settings - Fork 100
Can't Find Gem Berkshelf #318
Comments
I put some 'puts' in the area that the exception is thrown. Don't know if it helps but it appears to be that berkshelf is not on the 'classpath' even though it is when I list it, and I had installed it with a 'gem install'
AND
Results in: C:/HashiCorp/Vagrant/embedded/gems
|
Further investigation shows that, In Ruby, if the GEM_HOME environment variable is set then that OVERRIDES the "Gem.default_dir" path for Gems. Putting a "puts ENV" at the beginning of C:\opscode\chefdk\embedded\bin\berks.rb shows that when U run a vagrant up "GEM_PATH": "C:\HashiCorp\Vagrant\embedded\gems" BUT when I run I'm not sure then if this is a Vagrant issue or a Plugin issue. Tho I am going to check in with Vagrant as well |
In Vagrant-Berkshelf/helpers.rb there is a call to "Vagrant::Util::Env.with_clean_env do". I'm not sure if there is something here in the beginning of the plugin that would work better ? |
Yes, if I update "~.vagrant.d\gems\2.2.5\gems\vagrant-berkshelf-5.1.1\lib\vagrant-berkshelf\helpers.rb" and add the following at line 62
Everything works fine |
Thanks so much @gbonk, I've been stuck on this issue for months now. Thought it was a dark incompatibility between ChefDK, Vagrant and Berkshelf on particular conditions but it's far more simpler than that. I can finally use Vagrant again on Archlinux. |
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
Based on what @gbonk suggested , there is a less invasive hack which might work for some people. Just add these lines at the top of your Vagrantfile :
It works for me while using rbenv to manage my ruby versions. |
I'm trying to perform a fresh install with the latest of everything and using the Chocolatley provisioner on a windows 7 machine.
I have....
Here is my Vagrant File..
and my Berksfile
When I vagrant up, I receive the following warning and error...
The text was updated successfully, but these errors were encountered: