Include vs Require


Other than the syntax, I don't understand the difference between include & require.

Can anyone elaborate?


Maybe a google search would put you on track...
== discussions / opinions ==
ruby include vs require

11. require vs. include

Not a fan of stackoverflow. Really don't like the way it's laid out.

But isn't the point of these forums for support, to help one another, and build a database of discussions for other users.


I am resurrecting this topic now. but :slightly_smiling:

If you are just plan to use module or module functionality then you just require file, or module, where if you need or plan to extend or overwrite module, class or whatever than you will use include. That is why you actually require 'gems' in your Rails projects instead include them.