"uninitialized constant" Error for CalendarHelpper

After installing calendar_helper-0.2.3 gem, application using CalendarHelper works fine. Then I tried to test using rake command which gave me the following error.

Why does these messages appear evenif the application owrks fine. ------------------------------ Error Messags

After installing calendar_helper-0.2.3 gem, application using CalendarHelper works fine. Then I tried to test using rake command which gave me the following error.

Why does these messages appear evenif the application owrks fine.

Because the indication to require calendar helper is incorrect in cases where all the code is loaded ahead of time (the only time this doesn't happen is usually development)

Use config.gem instead

Fred

Frederick Cheung wrote:

Because the indication to require calendar helper is incorrect in cases where all the code is loaded ahead of time (the only time this doesn't happen is usually development)

Use config.gem instead

Thanks Fred.

I placed "config.gem 'calendar_helper'" in environment.rb as you indicated then the problem was solved.

Then next same error as below arose evenif I placed "config.gem 'actionpack'" same as the upper statement. ---------------error message-------------------- /usr/local/jruby-1.5.1/bin/jruby -I"lib:test" "/usr/local/jruby-1.5.1/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/functional/schedules_controller_test.rb" /usr/local/jruby-1.5.1/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:440:in `load_missing_constant': uninitialized constant SchedulesHelper::UploadedFile (NameError)   from /usr/local/jruby-1.5.1/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:80:in `const_missing_with_dependencies'   from /root/Aptana Studio/scheduler/app/helpers/schedules_helper.rb:3

Frederick Cheung wrote: >Because the indication to require calendar helper is incorrect in cases >where all the code is loaded ahead of time (the only time this doesn't >happen is usually development)

> Use config.gem instead

Thanks Fred.

I placed "config.gem 'calendar_helper'" in environment.rb as you indicated then the problem was solved.

Then next same error as below arose evenif I placed "config.gem 'actionpack'" same as the upper statement.

Don't do that - actionpack is part of rails and so is loaded anyway. Where does UploadedFile come from?

Fred

Frederick Cheung wrote:

Frederick Cheung wrote: >> indicated then the problem was solved.

>> Then next same error as below arose evenif I placed "config.gem >> 'actionpack'" same as the upper statement.

> Don't do that - actionpack is part of rails and so is loaded anyway. > Where does UploadedFile come from?

> Fred

Thank you for the comment.

'rake gems' tell me that 'actionpack' framework.

Module UploadedFile resides under actionpack-2.3.8/lib/action_controller/uploaded_file.rb. And original_filename method which I use is defined in UploadedFile module.

It will be ActionController::UploadedFile then. I'm not sure what you're trying to do my mixing that into one of your view helpers - that module is intended to be mixed into the objects representing file uploads - mixing it into your view helper module won't gain you a working original_filename method.

Fred