Ruby on Rails Sunday, May 7, 2017

On 7 May 2017 at 00:27, <> wrote:
> I have 2 warnings before output. What is the problem?
> Hello = "Hello, guys!"
> Hello2 = nil
> Hello2 = Hello
> puts Hello2
> puts Hello
> OUTPUT________________
> Variables.rb:7: warning: already initialized constant Hello2
> Variables.rb:5: warning: previous definition of Hello2 was here

Variables that begin with a capital letter are assumed by ruby to be
constants, so you get a warning if you try to change the value. Using
Rails it best to stick to the conventions, so variable names are of
the form name, another_name and so on.


You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
To view this discussion on the web visit
For more options, visit

No comments:

Post a Comment