What do we mean by this code if written in Gemfile

If I write the following code for example in 'Gemfile':

    group :development do     gem 'xyz'     end

    group:test do     gem 'xyz'     end

Thanks.

Only install the 'xyz' gem in the development and test environments. It can also be written as

group :development, :test do   gem 'xyz' end

Rails has three modes: production, development, and testing. An example: when you are developing an app, you may want to show the values of certain variables on each page, i.e. the views that are displayed. Looking at the values of those variables can help you understand where any errors might be occurring. In production mode, you obviously don't want values of variables being displayed a the bottom of your web page.

In your example, one gem is included in development mode(and presumably production mode), and another gem is included for testing mode only. So you could infer that the gem included for testing, is a gem that provides facilities for writing tests. It should be obvious that tests don't execute in production mode--that would slow down your app.

Only if there is a

group :production do   gem 'xyz' end

or the line

gem 'xyz'

not included in a 'group ... do' block. Otherwise presume nothing.

For further clarity Rails has three modes by *convention only* and you can create as many as you like. We have 'staging' for our staging environment and 'fallback' for the servers that will come online when if the hosting of the main servers fails. You could also have a 'q_and_a' environment for the QA team to do it's testing on.

just a detial more... for get the gems in the gemfile you must execute "bundle install" This way a third person don't have to know what gems are needed for you application, only execute bundle intall and ready