I just built a CLI Data gem and published it to RubyGems. Now if I try to do bundle install, I get the following error
``
You have one or more invalid gemspecs that need to be fixed.
The gemspec at
/home/himachhag-45739/code/popular-deals-from-slickdeals.net-`cli/popular_deals.gemspec`
is not valid. Please fix this gemspec.
The validation error was 'popular_deals-0.1.0 contains itself
(popular_deals-0.1.0.gem), check your files list'
Please see below my gmspec file:
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'popular_deals/version'
Gem::Specification.new do |spec|
spec.name = "popular_deals"
spec.version = PopularDeals::VERSION
spec.authors = ["'Hima Chitalia'"]
spec.email = ["'[email protected]'"]
spec.summary = %q{It displays popular deals of the day from https://slickdeals.net/deals/.}
#spec.description = %q{It displays popular deals of the day from https://slickdeals.net/deals/.}
spec.homepage = "https://github.com/HimaChitalia/popular_deals"
spec.license = "MIT"
spec.files = `git ls-files -z`.split("\x0").reject do |f|
f.match(%r{^(test|spec|features)/})
end
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]
spec.add_development_dependency "bundler", "~> 1.14"
spec.add_development_dependency "rake", "~> 10.0"
spec.add_development_dependency "pry"
spec.add_dependency "nokogiri"
spec.add_dependency "colorize"
end
What should I do to fix this? Thank you in advance for your help.
From http://siawyoung.com/coding/ruby/invalid-gemspec.html
It turns out this happens because the gemspec gets the list of files from the command
`git ls-files -z`.split("\x0")
So remove the file popular_deals-0.1.0.gem
from the repository and it should work.
rm popular_deals-0.1.0.gem
git add .
bundle install
Notice, you need git add . before bundle install, because you need update list of files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With