Closed phillipsnick closed 9 years ago
I had the same issue, so I created a new cookbook/Vagrant file to se if there were any syntax changes. The new config file had this line
config.berkshelf.berksfile_path = "./Berksfile"
I added that to my cookbook, and it worked.
Had a quick look in the code and have found the code which should handle this functionality. lib/vagrant-berkshelf/config.rb
Under the finalize method
def finalize!
@berksfile_path = nil if @berksfile_path == UNSET_VALUE
if @enabled == UNSET_VALUE
if @berksfile_path
# Automatically enable if a Berksfile path was given
@enabled = true
elsif File.exist?("Berksfile")
# Automatically enable when a Berksfile is persent
@berksfile_path = "Berksfile"
@enabled = true
end
end
@enabled = false if @enabled == UNSET_VALUE
@__finalized = true
end
Assuming this isn't being called on my setup, quite new to Ruby so not sure how this finalize method is called.
My ruby version
ruby -v
ruby 2.1.1p76 (2014-02-24 revision 45161)
@vidluther @phillipsnick where are you running the Vagrant command from? You're correct in the behavior you describe, but I suspect that File.exist?
call is running in the wrong directory. I bet we have to expand that bath relative to the Vagrantfile.
I'm running it from the root of my project, where Vagrantfile, berksfile etc is located.
My setup can be seen here https://github.com/phillipsnick/nickphillips.co
@phillipsnick @vidluther #236 please
Works perfectly :+1:
Thanks
I haven't had a chance to test, and probably will not till mid week, so I'll take @phillipsnick 's word for it :)
Just playing with the new version 4.0.0 of vagrant-berkshelf.
Reading the usage in the readme it looks like this should default to 'Berksfile' if the file exists?
But on Vagrant up I get the following message
If I add the following line to my Vagrantfile it all works fine.
Is this a bug or am I missing something here? (It's been a long day!)