Having issues following v1.1 plugin development documentation, rake package doesn't exist

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Having issues following v1.1 plugin development documentation, rake package doesn't exist

Jared McAteer
I'm following the Plugin packaging documentation and I can't seem to get Vagrant to recognize my plugin when trying to test it.  I've setup my plugin gem as such:

vagrant-myplugin.gemspec

lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'vagrant/myplugin/version'

Gem::Specification.new do |spec|
  spec.name          = "vagrant-myplugin"
  spec.version       = Vagrant::Myplugin::VERSION
  spec.authors       = ["Jared McAteer"]
  spec.email         = ["..."]
  spec.description   = "nothing here yet"
  spec.summary       = "nothing here yet"
  spec.homepage      = "http://myplugin.example.com"
  spec.license       = "MIT"

  spec.files         = `git ls-files`.split($/)
  spec.executables   = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
  spec.test_files    = spec.files.grep(%r{^(test|spec|features)/})
  spec.require_paths = ["lib"]

  spec.add_development_dependency "bundler", "~> 1.3"
  spec.add_development_dependency "rake"
end

Gemfile

source 'https://rubygems.org'

# Specify your gem's dependencies in vagrant-sails.gemspec
gemspec 

group :development do
  # We depend on Vagrant for development, but we don't add it as a
  # gem dependency because we expect to be installed within the
  # Vagrant environment itself using `vagrant plugin`.
  gem "vagrant", :git => "git://github.com/mitchellh/vagrant.git"
end

Rakefile

require 'rubygems'
require 'bundler/setup'
Bundler::GemHelper.install_tasks

According to the Plugin packaging documentation I should have a rake package option when I run rake -T, however, the only options are:

rake build
rake install
rake release

I hoped that the documentation just meant rake build so I tried running that and it created a vagrant-myplugin-0.0.1.gem in the pkg directory, I tried to run bundle exec vagrant up as per the instructions for the second method and I got the following error:

Vagrant failed to initialize at a very early stage:

The plugin "vagrant-myplugin" could not be found. Please make sure that it is
properly installed via `vagrant plugin`. Note that plugins made for
Vagrant 1.0.x are not compatible with 1.1+ and this error will likely
continue to show when you use `plugin install` with a 1.0.x plugin.

I tried moving the gem file from the pkg directory to the same place as the Vagrantfile, however, that did not make a difference. Any help would be greatly appreciated.

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.