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

The Bundler way and Jeweler #154

Closed
rgoytacaz opened this issue Nov 19, 2010 · 10 comments
Closed

The Bundler way and Jeweler #154

rgoytacaz opened this issue Nov 19, 2010 · 10 comments

Comments

@rgoytacaz
Copy link

This is not a bug just a reminder or documentation

I had doubts regarding how to use jeweler and how to make sure I get everything that jeweler provides, this are the bumps I had to go through.

  • I didn't know about the existence of options for jeweler, so I didn't know I could do this:

    jeweler --rspec your_gem 
    

You can learn about all the options available to you with just:
jeweler or jeweler -h

And the default is:
jeweler --shoulda --rdoc --bundler your_gem

same as:
jeweler your_gem

If you have git installed, its going to pickup your information automatically.

  • Weird enough, when I created a gemset for the new gem, somehow rake wasn't there. Maybe add rake to the generated Gemfile, would do the trick, but this is a default gem for any gemset, don't know why it wasn't there. It is on my global gemset.

  • Bundler says to put gemspec in your Gemfile, DO NOT DO IT. It causes a lot of trouble.

  • All your dependencies goes into your Gemfile only, remove all dependencies listings from your Rakefile.

  • The meta information you provide in your Rakefile, isn't the same thing as your_gem.gemspec . After you've done setting it up on Rakefile, remember no dependencies here, just run:

     rake gemspec
    

Jeweler generates your gemspec.

  • If you run into problems while executing rake tasks from jeweler, make sure you got jeweler installed (in case you create a new gemset), make sure you don't have gemspec in your Gemfile, and make sure Rake gem is there.
@retr0h
Copy link

retr0h commented Nov 24, 2010

What about development dependencies in the Gemfile? Seems less than ideal to have these become gem dependencies. ie rspec, minitest, cucumber, etc...

@rgoytacaz
Copy link
Author

group :development do
gem "rspec","2.1.0"

end

Jeweler will handle that for you.

@retr0h
Copy link

retr0h commented Nov 24, 2010

It doesn't appear to. Which is why I made the comment.
If I simply do rake gemspec, rspec is added to the list of gem dependencies.

Am I doing something wrong?
https://gist.github.com/714120

@rgoytacaz
Copy link
Author

Don't worry about that.
If you look closely at your gemspec, you will notice this lines.

if s.respond_to? :specification_version then
    current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
    s.specification_version = 3

    if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then

Its because of a change in the internal of Rubygems, so it check for the rubygem version, if its an old version it adds as (add_dependency) the newer version have (add_development_dependency) and (add_runtime_dependency).

Its just compatibility stuff.

@josevalim
Copy link
Contributor

This just bit me. I just released a gem with the wrong dependencies because I have updated jeweler. This should have been opt-in, otherwise a bunch of people using jeweler are going to release gems with the wrong dependencies because you are automatically importing from the Gemfile.

@rgoytacaz
Copy link
Author

I'm not a jeweler contributor/developer, but this seems to be affecting more people than just me. Can't all dependencies be at the Gemfile? and Why?

@erithmetic
Copy link
Collaborator

I have solved the problem of jeweler and bundler playing well together. Behold: http://github.com/dkastner/bueller

A lot of jeweler's functionality can actually be delegated to bundler. Bueller's only real job is to create gem skeletons, bump version numbers, and push out releases. You can now simply point your Gemfile to your gemspec. It also does away with the need to regenerate your gemspec all the time.

@retr0h
Copy link

retr0h commented Jan 31, 2011

I have actually moved over to just using bundler to create my gems.

http://asciicasts.com/episodes/245-new-gem-with-bundler

jeweler and bueller have too much functionality and litter my project with too many files.

@danmayer
Copy link

This bit me as well I had a gem release then noticed it had a runtime dependency on itself so you couldn't install the gem without install a previous older version of the gem first.... Grumble, if possible, a better default to avoid this would be good. Trust me it is really hard to search for gem circular dependency.

@nickmccurdy
Copy link

@retr0h Agreed. While I used to really like using jeweler back back when bundle gem didn't exist, I prefer using bundle gem now as it generates simpler code. If anyone is having trouble getting jeweler to work and you're using a recent version of gem, I recommend you try using bundle gem instead.

Also, I feel like it would make sense add any useful information in this issue to the documentation and then close this issue.

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

7 participants