Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jeweler adds circular dependency to my gem

Gem's(gemfoo) jeweler declaration in Rakefile looks like that:

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

The problem is that it generates the following dependencies in the gemfoo.gemspec file:

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

Which won't stop you from releasing your rubygem but won't allow you to install it:

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

How can I fix that?


jeweler 1.6.0

like image 354
user80805 Avatar asked May 12 '11 17:05

user80805


1 Answers

Something is broken in your Rakefile. Jeweler 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 = "[email protected]"
  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 - the generated gemspec file doesn't have the artifact you're describing.

like image 140
Roman Avatar answered Nov 16 '22 10:11

Roman