How to use Rails 3's ActiveSupport core extensions outside Rails

Ruby on-RailsRubygemsActivesupport

Ruby on-Rails Problem Overview


I'm having a problem using ActiveSupport's core extensions on a gem I am developing.

I had it working with AS 2.3.8, but as soon as I wanted to port it to 3b4, the extensions stopped working and my test results are filled with lines such as:

undefined method `blank?' for "something":String

I've included it via

gem "activesupport"

followed by

require "active_support"

Is there anything else I need to call to include those extensions?

Ruby on-Rails Solutions


Solution 1 - Ruby on-Rails

ActiveSupport is more separate now in Rails 3.

If you want the all active_support thing, you can require 'active_support/all' now.

But if you want only the blank? method, you can try

require 'active_support/core_ext/string'

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionchangelogView Question on Stackoverflow
Solution 1 - Ruby on-RailsshingaraView Answer on Stackoverflow