# Can activesupport gem be used in "standalone" fashion?

**URL:** <https://www.ruby-forum.com/t/can-activesupport-gem-be-used-in-standalone-fashion/56528>\
**Category:** Ruby\
**Created:** [March 31, 2006, 10:12pm UTC](https://www.ruby-forum.com/t/can-activesupport-gem-be-used-in-standalone-fashion/56528 "2006-03-31T22:12:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![john\_peter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/94ad74/32.png) [@john\_peter](https://www.ruby-forum.com/u/john_peter)\
**Post date:** [March 31, 2006, 10:12pm UTC](https://www.ruby-forum.com/t/can-activesupport-gem-be-used-in-standalone-fashion/56528/1 "2006-03-31T22:12:10Z")

</div>

i’m using ruby 1.8.2, rubygem 0.8.10, rails 1.0.0 where activesupport  
version = 1.2.5

when i try to run this in RADRail, i get a NoMethodError:

require ‘rubygems’  
require\_gem “activesupport”

print Time.now + 2.days

the error message is: c:/e312workspace/first/test3.rb:5: undefined  
method `days’ for 2:Fixnum (NoMethodError)

is there a way to use the numeric/time core\_ext in a plain ruby app? if  
so, how?  
thanks for any help!

---

<div class="post-metadata">

**Author:** ![john\_peter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/94ad74/32.png) [@john\_peter](https://www.ruby-forum.com/u/john_peter)\
**Post date:** [March 31, 2006, 10:18pm UTC](https://www.ruby-forum.com/t/can-activesupport-gem-be-used-in-standalone-fashion/56528/2 "2006-03-31T22:18:26Z")

</div>

I’m not sure why the above doesn’t work, but check below for a working  
version.

powerbook:~ michaelguterl$ irb  
irb(main):001:0\> require ‘rubygems’  
=\> true  
irb(main):002:0\> require ‘active\_support’  
=\> true  
irb(main):003:0\> Time.now + 2.days  
=\> Sun Apr 02 16:16:22 EDT 2006  
irb(main):004:0\>

---

<div class="post-metadata">

**Author:** ![john\_peter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/94ad74/32.png) [@john\_peter](https://www.ruby-forum.com/u/john_peter)\
**Post date:** [March 31, 2006, 10:24pm UTC](https://www.ruby-forum.com/t/can-activesupport-gem-be-used-in-standalone-fashion/56528/3 "2006-03-31T22:24:38Z")

</div>

Thanks! That worked. Not sure what was wrong with require\_gem

Michael G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote: I’m not sure why the above  
doesn’t work, but check below for a working  
version.

powerbook:~ michaelguterl$ irb  
irb(main):001:0\> require ‘rubygems’  
=\> true  
irb(main):002:0\> require ‘active\_support’  
=\> true  
irb(main):003:0\> Time.now + 2.days  
=\> Sun Apr 02 16:16:22 EDT 2006  
irb(main):004:0\>

---

<div class="post-metadata">

**Author:** ![john\_peter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/94ad74/32.png) [@john\_peter](https://www.ruby-forum.com/u/john_peter)\
**Post date:** [March 31, 2006, 11:53pm UTC](https://www.ruby-forum.com/t/can-activesupport-gem-be-used-in-standalone-fashion/56528/4 "2006-03-31T23:53:10Z")

</div>

thanks!

Logan C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:  
On Mar 31, 2006, at 3:23 PM, john peter wrote:

> Thanks! That worked. Not sure what was wrong with require\_gem

Nothing is wrong with require\_gem. It has an unfortunate name though.  
It should really be called activate\_gem or something similar.  
require\_gem only actually require’s the library if it uses  
autorequire, which is deprecated now.  
require\_gem is to select things like a given version of a gem, ie:  
require\_gem ‘some\_gem’, ‘\>= 1.0’  
you still have to do the  
require ‘some\_gem’ line

---

<div class="post-metadata">

**Author:** ![john\_peter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/94ad74/32.png) [@john\_peter](https://www.ruby-forum.com/u/john_peter)\
**Post date:** [March 31, 2006, 11:04pm UTC](https://www.ruby-forum.com/t/can-activesupport-gem-be-used-in-standalone-fashion/56528/5 "2006-03-31T23:04:20Z")

</div>

On Mar 31, 2006, at 3:23 PM, john peter wrote:

> Thanks! That worked. Not sure what was wrong with require\_gem

Nothing is wrong with require\_gem. It has an unfortunate name though.  
It should really be called activate\_gem or something similar.  
require\_gem only actually require’s the library if it uses  
autorequire, which is deprecated now.  
require\_gem is to select things like a given version of a gem, ie:  
require\_gem ‘some\_gem’, ‘\>= 1.0’  
you still have to do the  
require ‘some\_gem’ line
