1

Personnel in relation to add_runtime_dependency, add_dependency and add_development_dependency the "Gem Specification", I'm trying to understand them. How they work and how to differentiate them.

When I used the add_development_dependency, I was unable to observe anything different. When I used the add_dependency and also the add_runtime_dependency, the same effect was observed.

It was added to gemfile.lock as the only dependence of my gem, but not a project dependency. And I would like it to be added as a project dependency, because I think add redundant as a unit of my gem, and dependence of the project, adding it to the Gemfile.

What I do not understand is that if I add the jquery as a unit of my gem, but don't add it directly in the application Gemfile, it is not found. I get the following error.

"could not find file 'jquery'".

Richard Hamilton
  • 25,478
  • 10
  • 60
  • 87
rplaurindo
  • 1,277
  • 14
  • 23

1 Answers1

0

You should not gemfile.lock manually. You should include jquery-rails in Gemfile and do bundle install. gemfile.lock is managed by bundler. If you need dependencies only in a given environment you can do something like.

group :development do
  gem 'better_errors'
  gem 'bullet'
  gem 'lol_dba'
  gem 'meta_request'
  gem 'pry-rails'
  gem 'rbeautify'
  gem 'rsense'
  gem 'rubocop'
  gem 'spring'
  gem 'ruby-growl'
end

group :development, :test do
  gem 'binding_of_caller'
  gem 'jazz_hands'
end

Anything not in a specific group will be included in all environments.

Antarr Byrd
  • 24,863
  • 33
  • 100
  • 188