Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In certain situations, 1.5.1 adds duplicate dependency declarations to the gemspec #152

Open
snusnu opened this issue Nov 17, 2010 · 5 comments

Comments

@snusnu
Copy link
Contributor

snusnu commented Nov 17, 2010

If 1.5.1 sees a Gemfile, it puts the dependencies found in the :production and :development groups into the generated .gemspec. However, if those same dependencies are also declared in a Rakefile inside a Jeweler::Tasks.new definition, jeweler ends up listing the same dependencies twice in the .gemspec file it generates.

The workaround is to only put the dependency declarations into one place for now. So if the project has a Gemfile, the easiest thing to do is to just remove the dependency declarations from the Rakefile.

@andypearson
Copy link

I think I have found a slight variation in this...

I am building an engine gem, so I have a full Rails 3 app in my gem (for testing) in /spec_env, in spec_env, I include the gem I am building as a dependency in /spec_env/Gemfile with a path of '../'

Then I list my actual gem dependencies in my Rakefile, whilst using gemspec in my gems Gemfile (woah)

This seems to have the adverse effect that running rake gemspec creates a gem that depends on itself...

Of course, it could me me doing something odd, or downright wrong, but it does seem to be happening none the less...

@kristianmandrup
Copy link

I have been unable to install my own gems ever since upgrading to Rubygems 1.5

  File: roles_active_record-0.4.6.5.gem
Executing "ruby -S gem install ./pkg/roles_active_record-0.4.6.5.gem":
ruby -S gem install ./pkg/roles_active_record-0.4.6.5.gem
ERROR:  While executing gem ... (ArgumentError)
    undefined class/module YAML::PrivateType

Same error if installing via $ gem install pkg/roles_active_record-0.4.6.5.gem

Any ideas how to go about this!?

I am running Ruby 1.9.2-p386 on Mac OSX 10.6 (Snow)

http://help.rubygems.org/discussions/problems/483-gems-built-with-rubygems-150-ruby-192-do-not-install-properly-with-150-187

@technicalpickles
Copy link
Owner

@snusnu that's right, dependencies should be only defined in the Gemfile. The generated Rakefile has been updated to reflect this, so marking it as fixed. There's not a ton I can do for existing projects though.

@kristianmandrup that's a bug with ruby 1.9 and rubygems 1.5.0. It should be fixed in newer 1.5.x releases of rubygems.

Kyrremann pushed a commit to kevinzen/send_nsca that referenced this issue Mar 10, 2016
Got some tips from reading Jeweler issue [#152](technicalpickles/jeweler#152), so decided to remove the link to the gemspec from the Gemfile, and have all the necessary dependencies in the Gemfile
@samnissen
Copy link

samnissen commented Mar 9, 2017

@technicalpickles This advice runs counter to the README.md Dependencies section

Use gem.add_dependency to register them.

samnissen added a commit to samnissen/watir-webdriver-performance that referenced this issue Mar 9, 2017
@flajann2
Copy link
Collaborator

flajann2 commented Mar 9, 2017

There is an issue with the documentation, and I will take a look at this shortly.

@flajann2 flajann2 reopened this Mar 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants