If I write the following code for example in ''Gemfile'': group :development do gem ''xyz'' end group:test do gem ''xyz'' end Thanks. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Peter Hickman
2011-Aug-02 08:39 UTC
Re: What do we mean by this code if written in Gemfile
Only install the ''xyz'' gem in the development and test environments. It can also be written as group :development, :test do gem ''xyz'' end -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
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. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Peter Hickman
2011-Aug-02 09:02 UTC
Re: Re: What do we mean by this code if written in Gemfile
On 2 August 2011 09:44, 7stud -- <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> In your example, one gem is included in development mode(and presumably > production mode), and another gem is included for testing mode only. SoOnly 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. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
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 On 2 ago, 11:02, Peter Hickman <peterhickman...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 2 August 2011 09:44, 7stud -- <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: > > > In your example, one gem is included in development mode(and presumably > > production mode), and another gem is included for testing mode only. So > > 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.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.