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
2
votes
0 answers

Ruby Gem dependency versions

I finish my first gem. I want to publish it, but i have dependencies question. My gem has dependency of active_record(~> 4.1); And development_dependencies: rake, bundler, sqlite; How can I determine minimal and maximal versions of rake, bundler,…
2
votes
1 answer

Invalid gemspec in ...: wrong number of arguments (0 for 1+)

In my first attempt to create a gem, I have run into this error Invalid gemspec in [rulers.gemspec]: wrong number of arguments (0 for 1+) when I try to build it (gem build rulers.gemspec). I have pasted the code of the gemspec file below. Where have…
Noffica
  • 469
  • 8
  • 23
2
votes
0 answers

SSL: can't load CA certificate file /Users/xxxxx/goagent/local/CA.crt

server:~ Wanglichen$ pod setup /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.36.4/lib/cocoapods/command.rb:127: warning: Insecure world writable dir /usr in PATH, mode 040777 [!] The signature of CLAide#arguments has changed. Use…
2
votes
1 answer

Calling a method inside a do block in ruby

I'm trying to include files from all git submodules in a gemspec file. The gemspec reads as following require File.expand_path(File.dirname(__FILE__)) + '/lib/nameofgem.rb' # Gets all files, from all submodules, and returns them # as an array def…
SomeNorwegianGuy
  • 1,494
  • 4
  • 17
  • 43
2
votes
2 answers

What's the best way to do Ruby gemspec creation and dependency management?

Over the last few months, there have been a number of rapid developments in the state of Ruby dependency management and gem creation, to the point where I've been having trouble keeping up with everything. If I'm writing a new gem, what's the best…
John Feminella
  • 303,634
  • 46
  • 339
  • 357
2
votes
2 answers

Conditionally require gems in Gemfile based on Rails or Sinatra framework?

I am writing a gem that can be used with both Sinatra and Rails, however, the gem dependencies are different based on which framework the developer is using the gem on. If it's a rails app, we need 'sass-rails' and 'coffee-rails' If it's a sinatra…
Jeremy Baker
  • 3,986
  • 3
  • 24
  • 27
2
votes
2 answers

Private gem in gemspec

I need private gem in my gem and gemspec dependency can't contains git repository. So I stared my private server with geminabox and added source to my gemfile. When I bundle install or install gem called "core", then is installed gem from rubygems…
jirikolarik
  • 1,243
  • 1
  • 13
  • 25
2
votes
1 answer

Make config available through an entire ruby gem

I am creating a gem where I'd like to define some constants to be available. In my actual gemspec, I added the following: config = File.expand_path('../config', __FILE__) $LOAD_PATH.unshift(config) unless $LOAD_PATH.include?(config) require…
randombits
  • 47,058
  • 76
  • 251
  • 433
2
votes
2 answers

Is there a way to package all of the gem's my gem depends on WITH my gem?

I'm working on writing a gem that has several gem dependencies, one of which depends on a gem that broke backwards compatibility in a newer version. This got me to thinking - I don't want the gem that I'm building to become "that gem" that is making…
brightball
  • 923
  • 13
  • 11
2
votes
1 answer

Loading local gems through Bundler and mounted apps

I'm creating a gem (let's call it mygem) that is essentially a Sinatra server intended to be mounted within Rack based apps. Inside my gem's gemspec file, I have the following: gem.add_dependency 'kss' And Inside my gem's Gemfile, I have the…
joeellis
  • 2,745
  • 7
  • 28
  • 45
2
votes
1 answer

Gem definition: Ignore extconf.rb in JRuby

I have a gem with a C extension and java extension which installs fine in JRuby via rbenv, but fails to install in JRuby via RVM. The gemspec and project are on Github. I have tried explicitly listing the files in the gemspec, excluding the…
Dan McClain
  • 11,780
  • 9
  • 47
  • 67
2
votes
1 answer

How to do an "OR" when requiring a Gem version

Currently I have a Gemspec that requires a specific version of Rails 3.x with Rails > 3.1: Gem::Specification.new do |s| # (...) s.add_dependency "railties", "~> 3.1" # (...) end I am looking to update this statement to require ~> 3.1 OR ~>…
jmonteiro
  • 1,702
  • 15
  • 25
1
vote
2 answers

WARNING: Invalid .gemspec format in '/Library/Ruby/Gems/1.8/specifications/rack-1.3.5.gemspec'

I am trying to run a Sinatra app, and am failing because rack isn't being found. I am getting the following error: WARNING: Invalid .gemspec format in…
Francesca
  • 123
  • 1
  • 2
  • 5
1
vote
1 answer

Error pod installing on new macbook pro M1

I'm currently getting this issue when trying to pod install on my new macbook pro M1. Version: 12.0 (21A344) end ^~~ Traceback (most recent call last): 2: from /usr/local/bin/pod:25:in `
' 1: from…
Cary Wolff
  • 11
  • 4
1
vote
1 answer

What object processes new Gem::Specification objects?

What object/process picks up a newly created Specification object when running gem build against a typical gemspec file? For instance, suppose we have mynewgem.gemspec with contents as follows: Gem::Specification.new do |s| s.name = "mynewgem" …
Jacob M. Barnard
  • 1,347
  • 1
  • 10
  • 24