珠宝商为我的宝石添加了循环依赖

时间:2011-05-12 17:07:48

标签: ruby rubygems gem gemspecs

Rakefile中的Gem(gemfoo)珠宝商声明看起来像这样:

Jeweler::Tasks.new do |gem|
  #truncated
  gem.add_runtime_dependency 'nokogiri', '~> 1.4.1'
  gem.add_development_dependency 'jeweler'
end                             

问题是它在gemfoo.gemspec文件中生成以下依赖项:

s.add_runtime_dependency(%q<gemfoo>, [">= 0"]) s.add_runtime_dependency(%q<nokogiri>, ["~> 1.4.1"]) s.add_development_dependency(%q<jeweler>, [">= 0"])

这不会阻止您发布rubygem但不允许您安装它:

gem install gemfoo
ERROR:  Error installing gemfoo:
    gemfoo requires gemfoo (>= 0)

我该如何解决?


珠宝商1.6.0

1 个答案:

答案 0 :(得分:1)

你的Rakefile中有些东西坏了。珠宝商1.6.0


require 'jeweler'
Jeweler::Tasks.new do |gem|
  gem.name = "gemfoo"
  gem.summary = %Q{TODO: one-line summary of your gem}
  gem.description = %Q{TODO: longer description of your gem}
  gem.email = "john@example.com"
  gem.homepage = "http://www.google.com/"
  gem.authors = ["John Doe"]
  gem.add_runtime_dependency 'nokogiri', '~> 1.4.1'
  gem.add_development_dependency 'jeweler'
end
Jeweler::RubygemsDotOrgTasks.new

rake gemspec - 生成的gemspec文件没有您要描述的工件。