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
3
votes
1 answer

Any other way to circumvent the Illformed requirement YAML::Syck::DefaultKey errors then to upgrade RubyGems?

I am getting Invalid gemspec in [path/to/vendor/bundle/spree_api-1.0.0.gemspec]: Illformed requirement ["# 1.0.0"] for several gems (all Spree, and its spree_* requirements). I have reported the issue with…
berkes
  • 26,996
  • 27
  • 115
  • 206
3
votes
3 answers

How to check the compatible Ruby versions for a gem

How do I find out if a particular gem is compatible with a certain Ruby version or not? I want to upgrade the Ruby version of an application I am working on, But I did not see an authentic way of knowing which Ruby version is supported by a…
Nishutosh Sharma
  • 1,926
  • 2
  • 24
  • 39
3
votes
1 answer

Gem development with Bundler: include or exclude Gemfile?

I'm developing a gem locally. It's a command-line utility that only has test dependencies, and my Gemfile looks like this: source :rubygems gemspec group :test do gem "cucumber" gem "aruba" gem "rspec" end My gemspec looks like…
Josh French
  • 973
  • 1
  • 6
  • 12
3
votes
1 answer

How do i get rspec to read the dependencies in my gemspec?

When I run 'rspec' or 'bundle exec rspec' it doesn't let me use the dependencies in my .gemspec file. Do I have to repeat myself and break the DRY principle and display my gems in Gemfile and .gemspec?? (ps. I am doing this for my models files as…
Kamilski81
  • 14,409
  • 33
  • 108
  • 161
3
votes
1 answer

How to develop gems where one is dependent on the other

I have a gem A which has a dependency on gem B. Both gems are my own and are currently in private development. I have no plans to publish these to rubygems. I want to use gem A in my rails app. The problem is I'm getting this error when I try to…
robodisco
  • 4,162
  • 7
  • 34
  • 48
3
votes
1 answer

How to use a private gem server hosted gem when building another gem

If I've built a private gem (hosted internally at my company, for instance), then I want to reuse that gem in another gem (not app!) that I'm building, how do I do that? Where do I put my dependencies and tell my new gem how to find the old (already…
likethesky
  • 846
  • 3
  • 12
  • 28
3
votes
4 answers

How to use 'debugger' and 'pry' when developing a gem? (Ruby)

I'm developing a gem, and my Gemfile looks like this: source :rubygems gemspec group :development, :test do gem "pry" gem "debugger" gem "rake" end However, I don't want people to have to install pry and debugger when running tests, but I…
Janko
  • 8,985
  • 7
  • 34
  • 51
2
votes
1 answer

How to work with gemspec add_runtime_dependency and `bundle install`

I have a codebase which has a gemspec file like: require "rubygems" ::Gem::Specification.new do |specification| specification.add_development_dependency "yard", "~> 0.9" specification.add_runtime_dependency "dry-validation", "~>…
Kevin Buchs
  • 2,520
  • 4
  • 36
  • 55
2
votes
0 answers

Uanble to Install Jekyll - macOS Catalina

I am running Catalina (10.15.3) and am attempting to install Jekyll. When I do I appear to have the bundler install correctly but then have issues as shown below. Am a relative noob to working with terminal/Ruby etc. so any help would be…
Eric
  • 21
  • 2
2
votes
1 answer

Build Warning: Layout 'XXX-layout' requested in index.md does not exist in Jekyll?

I have created a theme of my own using Jekyll named 'north' which I have created by myself. After creating the theme I got a gem file as 'north-0.1.0.gem' and gemspec file as 'north.gemspec'. I took both of these file and paste inside a folder named…
Saurabh
  • 432
  • 1
  • 10
  • 23
2
votes
0 answers

Rails 5 Require a dependent gem and its initializers conditionally in a gem railtie

We are writing a gem that includes multiple common gems for a couple of our shared apps. We want to be able to have a config in application.rb or enviroment.rb/*rb something like config.fruit_chain.enable_transport = true from the consuming app to…
AirWick219
  • 894
  • 8
  • 27
2
votes
1 answer

gem spec: where do you specify dependencies that's useful in both runtime and development environments

If I understand correctly, spec.add_runtime_dependency "something" is for runtime dependencies. spec.add_development_dependency "something" is for development…
american-ninja-warrior
  • 7,397
  • 11
  • 46
  • 80
2
votes
1 answer

when i try to push a gem to rubygems i get a message saying it's not allowed in gemspec when it is

I'm trying to push a gem to rubygems.org and get this message: ERROR: "https://rubygems.org" is not allowed by the gemspec, which only allows "Set to 'http://mygemserver.com'" that generic mygemserver entry is the default entry in that line of the…
brocknroll
  • 31
  • 8
2
votes
0 answers

Bundler GemspecError when building inside Docker container

People were reporting this error and solved it by deleting a folder holding cached gems. Since I'm working inside a Docker container, this didn't seem like helpful advice for me. Indeed, the cache folder was not empty but did contain two items (I…
ruben.moor
  • 1,876
  • 15
  • 27
2
votes
1 answer

What's the easiest way to maintain a patched set of rails gems, with bundler?

We're transitioning from 'frozen' rails gems to using bundler and would like to maintain the rails gems with patches, merges etc. say from an external git source. What's the easiest way to set this up, adding gemspecs to the patch branches etc.?
tribalvibes
  • 2,097
  • 3
  • 25
  • 30