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

RoR, postgresql gemspec missing or broken when running console

My MacBook Air suddenly stoped working so I had to manually reboot... After that, when I run a rake test to fill a pg database it crashed. Now I'm at the point where I can't even run the console. These are the errors, any suggestions will be much…
fasito
  • 90
  • 6
0
votes
0 answers

Error: Guard will not detect changes to your Gemfile (Ruby gem)

I am trying to use Guard as a help for make Test Driven Development using Vim in Linux Shell. For add Guard dependecy, i added this to my .gemspec file: spec.add_development_dependency "guard" spec.add_development_dependency…
AER
  • 123
  • 1
  • 11
0
votes
0 answers

Could not find 'railties' (>= 0.a) among 14 total gem(s) (Gem::LoadError)

When running: $rails new app I get an error! (Recently updated ruby.) macOS Mojave 10.14.6 rails -v = ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin18] When running: $rails new…
0
votes
1 answer

What is reccomended practice for version restrictions in rubygem add_dependency?

When authoring a gem, what would be reccomended practice for version restrictions of dependencies. For example I know that know that my gem works wih rubyzip version 2.x, but I also know that it works for 1.9 as well. Should I state…
gorn
  • 5,042
  • 7
  • 31
  • 46
0
votes
0 answers

ruby gem inclusion still requires explicit dependencies in Gemfile

I have a Gem project that has the following in the mygem.gemspec file: Gem::Specification.new do |s| s.add_dependency 'some_other_gem' end Everything builds and publishes just fine for the Gem. In my Rails projects that use it, I have the…
el n00b
  • 1,957
  • 7
  • 37
  • 64
0
votes
0 answers

FileOverflow when I create a new gemfile in ruby

C:\Ruby193\lib\ruby\gems\1.9.1\gems\myproject> bundle package ... ... ... Updating files in vendor/cache Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed. Updating files in…
0
votes
1 answer

Maintaining a consistent Gemfile.lock for a gem with native extensions

I work in a team of engineers that develops a gem with native executables. For contractual reasons, it's important that when we deploy to a new environment, all dependencies use the same exact versions that we tested with. The Gemfile can only…
xanderflood
  • 826
  • 2
  • 12
  • 22
0
votes
0 answers

Version of a gem's runtime dependency

Can I let the choice of the version of a runtime dependency to the project that will use my gem? For example in my gem's gemspec : Gem::Specification.new do |s| s.name = "my-gem" [...] s.add_runtime_dependency 'my-other-gem' end And in the…
louisatome
  • 75
  • 1
  • 6
0
votes
1 answer

Gemspec resolve dependencies

I wanted to create a gem with some dependencies. I followed a tutorial, here is the full code. I have s.add_dependency "sinatra" In the gemspec. I build the gem. When I tried to install it with gem install --local gemname.gem I got ERROR: Could…
0
votes
1 answer

Publishing gem https://rubygems.org

I am trying to build a cli ruby gem. Everything is ready, just need to publish it. First I tried this, Enter your RubyGems.org credentials. …
Hima Chhag
  • 401
  • 7
  • 22
0
votes
1 answer

Updating a Rails Engine Version Number

In a rails engine when should the version number in lib/myengine/version.rb be updated? Should it be updated before every git push? If so, can/should the version number be updated with some automation, rather than changing the number in the file…
Gareth Fuller
  • 328
  • 2
  • 12
0
votes
1 answer

Ruby Unresolved specs during Gem::Specification.reset with installed gems

I have a gem which we'll call mygem that has an executable used as a CLI tool. The file mygem/bin/mygem: #!/usr/bin/env ruby lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require…
Drew
  • 15
  • 3
0
votes
1 answer

Trying to do a bundle fails with "There was a SyntaxError while loading arel.gemspec"

This is the error I get when I do a bundle in the rails repo in the master branch. There was a SyntaxError while loading arel.gemspec: /home/apnabhzu/ruby/gems/bundler/gems/arel-3c429c5d86e9/lib/arel/table.rb:14: syntax error, unexpected tLABEL …
bitsapien
  • 1,753
  • 12
  • 24
0
votes
1 answer

How do I add runtime dependency for java with jruby

I've create a wrapper gem for connecting to a tibco queue & uploaded that gem to my local gemserver. When I try to include the wrapper gem in other projects, I get the following error: Bundler could not find compatible versions for gem "jruby-jms": …
Dave McNulla
  • 2,006
  • 16
  • 23
0
votes
2 answers

Questions about building a new gem using Wycats template

I'm writing a new gem I'm basing off of Yehuda's new gem template and I'm slightly confused. Having a Gemfile with dependencies, and also specifying a gemspec with dependencies seems redundant to me. Can someone explain why this is desirable and…
brad
  • 31,987
  • 28
  • 102
  • 155