Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby Ruby Modules Ruby Core Modules Enumerable

Travis Eubanks
Travis Eubanks
12,566 Points

When to include modules

So If im not working on any framework like Rails and im just simply trying to build a program in ruby... do I have to 'include <Module name>' for every module I want to use for intance like Math and Enumerable? OR is there like a standard library I can INCLUDE that stores all the "standard" libraries kind of like rails does

2 Answers

Raymond Sapida
Raymond Sapida
33,049 Points

Hi there,

Ruby has a lot of the basic libraries that most people use. If you're building a program with just Ruby, all the core objects are included but you have to include modules like Enumerable and Comparable.

Outside of that, if you wanted to use methods available in Rails, you could add Rails Active Support which extends some of the Ruby classes. You could add the whole thing or pick which parts you wanted to include for your program. It's the closest thing I know to a Ruby standard library that isn't already included in Ruby.

Travis Eubanks
Travis Eubanks
12,566 Points

Great thank you Raymond appreciate the insight!

Hi guys,

This is the second time the Active Support extension / gem has been mentioned on the forum. The first time was here (which also mentions ActiveRecord) :


My question/comment:

Is there going to be a Ruby course with a deep dive into Active Support coming up eventually in the roadmap?

Some links:

Article: Some Ways ActiveSupport Helps Ruby Developers:


Instrumenting Your Code With ActiveSupport Notifications:


Some old articles / tutorials on ActiveSupport::Callbacks



Active Support Github:


--by the way, according to this stackoverflow thread, ActiveSupport "ActiveSupport is more separate now in Rails 3":


Raymond Sapida
Raymond Sapida
33,049 Points

It would be really great if there was a course on it here. Most of what I know about Active Support is from the Ruby on Rails guide on it. And thank you, for the links you added. They were very helpful to me since I've been trying to find more resources on how to use active support effectively. It just feels like there so much included in that module that it's difficult to decide where to begin.