jantman / vagrant-r10k

UNSUPPORTED - SEEKING MAINTAINER - Vagrant middleware plugin to retrieve puppet modules using r10k.
MIT License
35 stars 12 forks source link

undefined method `activate_bin_path' #41

Closed ranzbak closed 7 years ago

ranzbak commented 7 years ago

When I start vagrant on OSX I get the following error :

[2017-04-12 11:14:29 - ERROR] Task # failed while running: Command exited with non-zero exit code: Command: puppet module --modulepath /Users/phonig/work/vagrant/vagrant-puppet-example/puppet/modules/ --color false install --force puppetlabs/stdlib Stderr: /usr/local/bin/puppet:22:in <main>': undefined methodactivate_bin_path' for Gem:Module (NoMethodError) Exit code: 1

When I run Puppet on the command line, it downloads the module without error.

I've attached the vagrant up --debug output. vagrant-up.txt

jantman commented 7 years ago

@ranzbak It's probably going to take me a while to dig into this, as I'm currently on vacation.

The fact that the error is in puppet itself and is related to Gem::Module makes me think that this is most likely related to changes in a recent version of something. Honestly this gem hasn't received much attention in quite a while; the newest Vagrant version tested against is 1.7.0, but you're running 1.9.3. We have r10k pinned to the 1.5 series because 2.x introduced major changes that would need a major refactor...

I should be able to look into this more next week when I get back. Until then, do you think you could please send me the output of /usr/local/bin/puppet --version?

ranzbak commented 7 years ago

/usr/local/bin/puppet --version 4.10.0

Could the bundled version of Ruby in Vagrant be the problem?

ranzbak commented 7 years ago

Hi,

I'm still trying to get to the bottom of this. Puppet works from the command line, but when I run via vagrant, find _spec_for_exec fails.

Code line 298 rubygems.rb

spec = find_spec_for_exe name, exec_name, [requirement]
Gem::LOADED_SPECS_MUTEX.synchronize { spec.activate }
spec.bin_file exec_name

Is there something in the environment that is not set? What am I missing here?

ranzbak commented 7 years ago

I found that Vagrant 1.9.x has a problem on OSX where the GEM_PATH of the embedded Ruby is pointing to the wrong path. The link below discusses the problem. https://github.com/mitchellh/vagrant/issues/8235 Downgrading to Vagrant 1.8.7 solved the problem for.

jantman commented 7 years ago

Apologies for my lack of response, but I'm glad you found the issue and a workaround.

For future reference, this was apparently fixed in https://github.com/mitchellh/vagrant/pull/8248