Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add a gem in development group from a Rails engine?

Im developing a Rails engine that includes 3 dependencies:

gemspec

s.add_dependency "rswag-api"
s.add_dependency "rswag-ui"
s.add_dependency "rswag-specs"

My problem is I want the third gem (rswag-specs) available in my host application under development environment only. Normally, in a Rails app would do this:

Gemfile

group :development, :test do
  gem 'rswag-specs'
end

I need to do something similar from my gem instead.

UPDATE

s.add_development_dependency will not install the gem in group :development

enter image description here

like image 973
Leantraxxx Avatar asked Oct 17 '25 01:10

Leantraxxx


1 Answers

Try this:

s.add_development_dependency 'rswag-specs'

This is directly from the docs

like image 153
hashrocket Avatar answered Oct 19 '25 15:10

hashrocket



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!