对于CLI Data gem,gem包含自身错误

Him*_*hag 2 ruby bundle rubygems

我刚刚构建了一个CLI Data gem并将其发布到RubyGems.现在,如果我尝试进行捆绑安装,我会收到以下错误

``

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'
Run Code Online (Sandbox Code Playgroud)

请参阅下面我的gmspec文件:

# 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         = ["'hima_chhag@yahoo.com'"]

  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
Run Code Online (Sandbox Code Playgroud)

我该怎么做才能解决这个问题?预先感谢您的帮助.

ota*_*iko 10

来自http://siawyoung.com/coding/ruby/invalid-gemspec.html

事实证明这是因为gemspec从命令中获取文件列表

`git ls-files -z`.split("\x0")
Run Code Online (Sandbox Code Playgroud)

因此,popular_deals-0.1.0.gem从存储库中删除该文件,它应该工作.


vk2*_*k26 7

rm popular_deals-0.1.0.gem
git add .
bundle install
Run Code Online (Sandbox Code Playgroud)

注意,你需要git add 。bundle install之前,因为您需要更新文件列表。