Questions tagged [gemspecs]

The gemspec file defines a Gem::Specification object.

A gem consists of two things:

  1. some code
  2. a gemspec file

The gemspec file defines a Gem::Specification object. It contains the required information for a gem. Starting in RubyGems 2.0, a Specification can hold arbitrary metadata.

REQUIRED GEMSPEC ATTRIBUTES

  • author=
  • authors=
  • files
  • name
  • platform=
  • require_paths=
  • rubygems_version
  • summary
  • version

Apart from the list, there are some more attributes that can be included in the gemspec file. These attributes are optional. Some of them are license=, description etc.

117 questions
1
vote
2 answers

Can I specify dynamic dependencies for my gem based on command line input?

Intro: I'm working on a gem that, by default, will pull information out of some XML data and do some sort of processing on the document. I'm using nokogiri to parse the XML. However, I wish to allow the user to parse the XML themselves and pass in…
Michelle Tilley
  • 157,729
  • 40
  • 374
  • 311
1
vote
1 answer

how to fix Invalid gemspec

I found a bug when checking the vagrant version in ubuntu terminal It returns these following error: Invalid gemspec in [/usr/share/rubygems-integration/all/specifications/rbnacl-libsodium.gemspec]: stack level too deep
Shawn
  • 1,232
  • 1
  • 14
  • 44
1
vote
1 answer

Should the Gemspec be packaged with a Ruby Gem?

I read that we shouldn't package test files with a Ruby Gem. Now I'm wondering, if we should package the Gemspec. For example, given the following Ruby Gem: tree . . ├── LICENSE.txt ├── README.md ├── lib │   └── simplegem.rb ├──…
mbigras
  • 7,664
  • 11
  • 50
  • 111
1
vote
1 answer

Bundler: Create Gem - Default Contact Info Source?

I followed this guide to build my first Ruby Gem: http://bundler.io/v1.12/guides/creating_gem.html Everything worked as expected, but I have one question: I noticed that Bundler auto-magically pulled my personal contact info from somewhere (I'm on a…
Pseudo
  • 31
  • 4
1
vote
1 answer

How do I require a private ruby gem from another private ruby gem?

I have a private gem, called X, whose source code is hosted on Github. If I want to use X in a project, I add gem 'X', :git => 'git@github.com:my-org/x.git' to my project's Gemfile. I can then launch irb and type require 'bundler/setup' and then…
jerzy
  • 2,364
  • 4
  • 20
  • 24
1
vote
2 answers

rake task not found when create rails plugin

I'm trying to create a gem plugin with a rake task. I just commented out pre-generated file in tasks folder but when I run rake my_plugin, error came out that Don't know how to build task... here is tasks/my_plugin.rake file desc "Explaining what…
Cụt Cánh
  • 375
  • 2
  • 10
1
vote
0 answers

Updating the gem versions in the gemspec file automatically

My *.gemspec file holds content like this: Gem::Specification.new do |spec| ... spec.add_development_dependency "guard", "~> 2.12.6" spec.add_development_dependency "unicorn" .... end Is there an automated way to change/add all the…
Peter Butkovic
  • 11,143
  • 10
  • 57
  • 81
1
vote
1 answer

including executable file with gem

The gem in question is on my GItHub I am also on Linux, specifically Ubuntu. I am trying to make the gem compatible for Linux/OSX users at this point, with a focus on Windows users after it is working correctly for *nix systems. So I have written a…
user2993456
1
vote
1 answer

Update ruby gem version with new changings

I have developed a gem for learning purposes and push it to https://rubygems.org/gems/combination-pairs. Now I want to do some changes in the code of the gem. Means I want to update my same gem but with different version. How can we do the same??
Tarun Garg
  • 717
  • 6
  • 19
1
vote
0 answers

Is there a way to use Yard Markup with RDoc in a Gem?

The exact question is: How can I instruct gem to generate my documentation with Yard. The old way using #has_rdoc doesn't function any more. I cannot find the method to do it using metadata in newer GemSpec versions. I would prefer using Yard over…
Andrei Beliankou
  • 684
  • 7
  • 17
1
vote
3 answers

Rails Engines: Where to define gems only used in testing

I'm building an engine, and I want to use VCR and Webmock for testing. The documentation within the Gemfile generated when an engine is created, seems to suggest that all an engine's gems should be loaded via gemspec, but the only options for this…
ReggieB
  • 8,100
  • 3
  • 38
  • 46
1
vote
1 answer

Starting Ruby Gem versioning within a Rails application

I have a Rails application that is pointing to a gem which is on github (not yet pushed to Ruby Gems) and it is not yet versioned so when I run bundle it looks like this: gem (0.0.0) from git@github.com:company/gem.git (at master) I have been…
BC00
  • 1,589
  • 3
  • 29
  • 47
1
vote
1 answer

Why is bundler using the wrong gemspec file?

I've got a custom gem that has been working just fine with regards to bundling, building, distributing, & implementing. The gem is the core of a framework from which other gems are derived. Since most derived gems will have the same basic…
Matt Huggins
  • 81,398
  • 36
  • 149
  • 218
1
vote
1 answer

Is there any way to add a conflict to a gemspec

I'm making a gem called something like ugly_fork_of_foo. Can I add something to my gemspec to tell the system that ugly_fork_of_foo conflicts with foo, that both can't be installed simultaneously?
Bryan Larsen
  • 9,468
  • 8
  • 56
  • 46
0
votes
1 answer

during a local gem install of the gem I created I get a "Unable to resolve dependencies"?

why would I get this error when trying to do a local install of the gem I just created. Note I do not want to publish it out on internet, just use it myself internally: MacBook-Pro:$ sudo gem install ./mylibrary-0.1.0.gem ERROR: While executing…
Greg
  • 34,042
  • 79
  • 253
  • 454