Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gemfile group is used for?

I know the "group" method is used for specify gems for specific environments.

group :development, :test do
  gem "rspec-rails", ">= 2.0.0.beta.19"
  gem "cucumber-rails", ">= 0.3.2"
  gem "webrat", ">= 0.7.2.beta.1"
end

But I dont get what it means. So these could just be used when im in development and test environment?

But will it be installed in production?

like image 277
never_had_a_name Avatar asked Aug 12 '10 11:08

never_had_a_name


People also ask

What is Gemfile used for?

A Gemfile is a file that is created to describe the gem dependencies required to run a Ruby program. A Gemfile should always be placed in the root of the project directory.

What is require in Gemfile?

Gemfiles. Gemfiles require at least one gem source, in the form of the URL for a RubyGems server. Generate a Gemfile with the default rubygems.org source by running bundle init . If you can, use https so your connection to the rubygems.org server will be verified with SSL.

What are groups in gem file?

We see there are two groups (:development and :test) added to our Gemfile. This helps us in installing gems only for specific environments. Gems installed in the development group will only be available in the development environment and the same goes for the rest.

What is Gemfile in react native?

A Gemfile is a ruby file that defines your ruby dependencies. Here is an existing one from a Cocoa project. source 'https://rubygems.org' gem 'cocoapods' gem 'cocoapods-keys' gem 'fui', '~> 0.3.0' gem 'xcpretty' gem 'second_curtain', '~> 0.2.3' gem 'fastlane'


1 Answers

It means you don't need this gem in production. But if you want use test or development mode, you need it.

You can install without some group with bundler like :

bundle install --without= development test

In this case all gems in development and test group are not installed and not required.

like image 105
shingara Avatar answered Oct 30 '22 21:10

shingara