Hi,
I''m trying to use the module
ActiveSupport::CoreExtensions::Time::Calculations in a helper module,
but I get a nasty error. My module looks like this:
require ''rubygems''
gem ''activesupport''
include ActiveSupport::CoreExtensions::Time::Calculations
module CalendarHelper
# code....
days = self.class.days_in_month(month, year)
# more code...
But every time I invoke it, I get the following error:
#<NameError: cannot remove Object::ClassMethods>
["/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:422:in
`remove_const''",
"/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:422:in
`remove_constant''",
"/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:273:in
`remove_unloadable_constants!''",
"/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:273:in
`remove_unloadable_constants!''",
"/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:72:in
`clear''",
"/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:60:in
`reset_application!''",
"/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:116:in
`reset_after_dispatch''",
"/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:51:in
`dispatch''",
"/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb:113:in
`handle_dispatch''",
"/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb:79:in
`service''",
"/usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in
`service''",
"/usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in `run''",
"/usr/local/lib/ruby/1.8/webrick/server.rb:173:in
`start_thread''",
"/usr/local/lib/ruby/1.8/webrick/server.rb:162:in
`start_thread''",
"/usr/local/lib/ruby/1.8/webrick/server.rb:95:in `start''",
"/usr/local/lib/ruby/1.8/webrick/server.rb:92:in `start''",
"/usr/local/lib/ruby/1.8/webrick/server.rb:23:in `start''",
"/usr/local/lib/ruby/1.8/webrick/server.rb:82:in `start''",
"/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb:63:in
`dispatch''",
"/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/servers/webrick.rb:59",
"/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require''",
"/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in
`require''",
"/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in
`new_constants_in''",
"/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in
`require''",
"/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/server.rb:39",
"/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require''", "script/server:3"]
Do you know what''s going on ? It''s a bit hard to be a newbie
in this RnR
world (now I understand how people new to Java feel like...)
Thanks in advance,
Juan
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---