Tsuyoshi Takahashi
2010-Aug-13 08:08 UTC
"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:in `const_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? -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Frederick Cheung
2010-Aug-13 10:04 UTC
Re: "uninitialized constant" Error for CalendarHelpper
On 13 Aug 2010, at 09:08, Tsuyoshi Takahashi <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> 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> ------------------------------ 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:in > `const_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? > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Tsuyoshi Takahashi
2010-Aug-14 04:37 UTC
Re: "uninitialized constant" Error for CalendarHelpper
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 ----------------------------------------------- module SchedulesHelper include CalendarHelper include UploadedFile end ------------------------------------------------- What is the difference between 2 cases. Tsuyoshi -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Frederick Cheung
2010-Aug-14 10:34 UTC
Re: "uninitialized constant" Error for CalendarHelpper
On Aug 14, 5:37 am, Tsuyoshi Takahashi <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> 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> ---------------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_tes t_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/activ e_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/activ e_support/dependencies.rb:80:in > `const_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 > > -- > Posted viahttp://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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Tsuyoshi Takahashi
2010-Aug-14 13:39 UTC
Re: "uninitialized constant" Error for CalendarHelpper
Frederick Cheung wrote:> On Aug 14, 5:37�am, Tsuyoshi Takahashi <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> 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? > > FredThank 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 -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Frederick Cheung
2010-Aug-14 14:19 UTC
Re: "uninitialized constant" Error for CalendarHelpper
On Aug 14, 2:39 pm, Tsuyoshi Takahashi <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Frederick Cheung wrote: > > On Aug 14, 5:37 am, Tsuyoshi Takahashi <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> 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> Tsuyoshi > -- > Posted viahttp://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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.