If I write the following code for example in 'Gemfile':
group :development do
gem 'xyz'
end
group:test do
gem 'xyz'
end
What do开发者_开发百科es that mean?
Thanks.
You can specify which gems should be installed in which environment. For example, you might wanna use SQLite for development and testing, but MySQL on production. So you would write:
gem 'devise'
group :development, :test do
gem 'sqlite'
end
group :production do
gem 'mysql2'
end
Running bundle install --without development:test
will install devise and mysql2 gems.
Only install the xyz
gem in the development and test environments.
It can also be written as:
group :development, :test do
gem 'xyz'
end
It means that all those gems in blocks will be loaded only in this environmets (test or development)
精彩评论