"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

/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::CalendarHelper (NameError) from /usr/local/jruby-1.5.1/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:80:inconst_missing_with_dependencies’
from /root/Aptana Studio/scheduler/app/helpers/schedules_helper.rb:2
from /root/Aptana
Studio/scheduler/app/helpers/schedules_helper.rb:31:in `require’

Environment: OS:VineLinux 5.1, platform:AptanaStudio, Ruby:Jruby-1.5.1,
DB:MySQL, adapter:activerecord-jdbcmysql-adapter-0.9.7

Placed ‘include CalendarHelper’ in schedules_helper.rb and “require
‘calendar_helper’” statement at the bottom of config/environment.rb.

Does someone know how to solve this?

On 13 Aug 2010, at 09:08, Tsuyoshi T. [email protected]
wrote:

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 C. 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:inconst_missing_with_dependencies’
from /root/Aptana Studio/scheduler/app/helpers/schedules_helper.rb:3

module SchedulesHelper
include CalendarHelper
include UploadedFile
end

What is the difference between 2 cases.

Tsuyoshi

On Aug 14, 5:37 am, Tsuyoshi T. [email protected] 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

On Aug 14, 2:39 pm, Tsuyoshi T. [email protected] wrote:

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

Frederick C. wrote:

On Aug 14, 5:37�am, Tsuyoshi T. [email protected] 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.

Tsuyoshi

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs