can activesupport gem be used in "standalone" fashion?

J

john peter

--0-526318835-1143835798=:40397
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

i'm using ruby 1.8.2, rubygem 0.8.10, rails 1.0.0 where activesupport =
version =3D 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 s=
o, how?
thanks for any help!

=09
 
M

Michael Guterl

------=_Part_8276_12575957.1143836268870
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

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'
=3D> true
irb(main):002:0> require 'active_support'
=3D> true
irb(main):003:0> Time.now + 2.days
=3D> Sun Apr 02 16:16:22 EDT 2006
irb(main):004:0>


i'm using ruby 1.8.2, rubygem 0.8.10, rails 1.0.0 where activesupport
version =3D 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!

------=_Part_8276_12575957.1143836268870--
 
J

john peter

--0-1116973138-1143836627=:10784
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Thanks! That worked. Not sure what was wrong with require_gem=20

n't work, but check below for a working
version.

powerbook:~ michaelguterl$ irb
irb(main):001:0> require 'rubygems'
=3D> true
irb(main):002:0> require 'active_support'
=3D> true
irb(main):003:0> Time.now + 2.days
=3D> Sun Apr 02 16:16:22 EDT 2006
irb(main):004:0>


i'm using ruby 1.8.2, rubygem 0.8.10, rails 1.0.0 where activesuppor= t
version =3D 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 meth= od
`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!


=09
 
L

Logan Capaldo

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. =20
require_gem only actually require's the library if it uses =20
autorequire, which is deprecated now.
require_gem is to select things like a given version of a gem, ie:
require_gem 'some_gem', '>=3D 1.0'
you still have to do the
require 'some_gem' line
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top