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

`find_spec_for_exe': can't find gem puppet (>= 0.a) (Gem::GemNotFoundException) #43

Closed
Falkor opened this issue May 2, 2018 · 4 comments

Comments

@Falkor
Copy link

Falkor commented May 2, 2018

I have installed the vagrant-r10k plugin, together with the puppet gem as suggested:

$> vagrant --version 
Vagrant 2.0.4
$> vagrant plugin list  
oscar (0.5.3)
puppet (5.5.1)
terminal-table (1.8.0)
vagrant-cachier (1.2.1)
vagrant-hosts (2.8.0)
vagrant-r10k (0.4.1)
vagrant-triggers (0.5.3)
vagrant-vbguest (0.15.1)

The project I'm using (relying on RVM and Gemset) has the following structure:

.
├── Gemfile
├── Gemfile.lock
├── Makefile
├── README.md
├── VERSION
├── Vagrantfile
├── puppet
│   ├── Puppetfile
│   ├── manifests
│   │   └── default.pp
│   └── modules
└── vagrant

The puppet/Puppetfile has the following content:

forge "https://forgeapi.puppetlabs.com"

# Officials from Puppetlabs / Puppet
mod 'puppetlabs/apache',              :latest
mod 'puppetlabs/git',                 :latest
mod "puppetlabs/vcsrepo",             :latest

Finally, the configuration for vagrant-r10k in the root Vagrantfile is as follows:

  # Puppet R10K configuration (from vagrant-r10k plugin)
  config.r10k.puppet_dir      = 'puppet'
  config.r10k.puppetfile_path = "puppet/Puppetfile"
  config.r10k.module_path     = 'puppet/modules'

Now if I invoke vagrant {up,provision}, I get the following error:

==> default: vagrant-r10k: Beginning r10k deploy of puppet modules into /path/to/project/puppet/modules using /path/to/project/puppet/Puppetfile
INFO	 -> Loading modules from Puppetfile into queue
INFO	 -> Deploying vcsrepo into /path/to/project/puppet/modules
ERROR	 -> Task #<R10K::Task::Module::Sync:0x0000000100f3a4e8> failed while running: Command exited with non-zero exit code:
Command: puppet module --modulepath /path/to/project/puppet/modules --color false install --version=2.3.0 --force puppetlabs/vcsrepo
Stderr:
/opt/vagrant/embedded/lib/ruby/2.4.0/rubygems.rb:271:in `find_spec_for_exe': can't find gem puppet (>= 0.a) (Gem::GemNotFoundException)
	from /opt/vagrant/embedded/lib/ruby/2.4.0/rubygems.rb:299:in `activate_bin_path'
	from $HOME/.rvm/gems/ruby-2.3.4@BSP/bin/puppet:23:in `<main>'
	from $HOME/.rvm/gems/ruby-2.3.4@BSP/bin/ruby_executable_hooks:15:in `eval'
	from$HOME/.rvm/gems/ruby-2.3.4@BSP/bin/ruby_executable_hooks:15:in `<main>'
Exit code: 1
[...]

of course repeated for each module in the Puppetfile.
It looks like the gem path to the vagrant plugin is ignored... Any hint?

@jantman
Copy link
Owner

jantman commented May 2, 2018

@Falkor I'm sorry to have to say this, but I have no idea :(

I haven't used this project myself in over 3 years. At a minimum, I can say that the newest versions the automated tests run against are ruby 2.0.0 and Vagrant 1.7.0.

My guess would be that either Vagrant 2, or the Ruby 2.3.4 or 2.4.0 that it now uses broke compatibility with this project.

I feel bad having to say this, but I no longer have the ability or desire to maintain this project. If you happen to know someone who would like to take it over, I'd be more than happy to set that up.

@jantman
Copy link
Owner

jantman commented Jul 28, 2018

Closing as stale.

@jantman jantman closed this as completed Jul 28, 2018
@ranzbak
Copy link

ranzbak commented Aug 21, 2018

I managed to get it working with Vagrant 2.1.2 running the following command:

gem install puppet -v 4.10.12 --install-dir ~/.gem/ruby/2.4.0

(I'm still using Puppet 4.10.12, your version of Puppet might be different.)
I hope this helps somebody.

@ranzbak
Copy link

ranzbak commented Oct 3, 2018

Also if all else fails, the very dirty workaround I came up with is

# vagrant up 2>&1 | grep 'Command: ' | sed 's/^Command: //' | while read -r line; do sh -c /usr/local/bin/${line}; done

It's very dirty, but when in a bind it's better than copy pasting the command lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants