Michael Li
2009-Oct-26 02:57 UTC
Rails 2.3.4 - can''t find method `cache_template_extensions''
I''ve come up with an unusual problem right after installing Ruby+RoR. When I start server or console, I get these two errors: C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:602:in `send'': undefined method `cache_template_extensions='' for ActionView::Base:Class (NoMethodError) C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:443:in `load_missing_constant'':NameError: uninitialized constant ApplicationController I see that "cache_template_extensions" defined to ''false'' in environments/development.rb, so I added to environment.rb ENV[''RAILS_ENV''] ||= ''development'' just to make sure. (Even though initializer.rb sets it to ''development'' by default anyway). This is latest Ruby 1.8.6 and RoR 2.3.4 on a Windows Vista 64-bit desktop. I copied a small project that I was developing on another WinXP machine here and tried to start WEBrick with ruby script/server. The project was originally done under InstantRails, which is based on RoR 2.0.2. So I updated to: RAILS_GEM_VERSION = ''2.3.4'' unless defined? RAILS_GEM_VERSION None of this helps. When I start the console, I get those two messages, but the console starts. When I try to start a server (WEBrick), I get this full stack and it stops. c:\Ruby\rails_apps\logbook>ruby script/server => Booting WEBrick => Rails 2.3.4 application starting on http://0.0.0.0:3000 C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:602:in `send'': undefined method `cache_template_extensions='' for ActionView::Base:Class (NoMethodError) from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:602:in `initialize_framework_settings'' from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:601:in `each'' from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:601:in `initialize_framework_settings'' from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:598:in `each'' from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:598:in `initialize_framework_settings'' from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:155:in `process'' from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in `send'' from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in `run'' ... 6 levels... from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/commands/server.rb:84 from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'' from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'' from script/server:3 ------------------- How can I make it work? Thank you! MikeL -- Posted via http://www.ruby-forum.com/.
Conrad Taylor
2009-Oct-26 03:08 UTC
Re: Rails 2.3.4 - can''t find method `cache_template_extensions''
Hi, in short, caching is disabled in development mode by default. Otherwise, you can enable it as needed. Usually, it might be better to creating another environment file like staging or start your application in production mode. Next, you''ll need to perform the following when changing the RAILS_GEM_VERSION: rake rails:update Give this a try and let us know how it goes. -Conrad On Sun, Oct 25, 2009 at 7:57 PM, Michael Li < rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > I''ve come up with an unusual problem right after installing Ruby+RoR. > When I start server or console, I get these two errors: > > C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:602:in > `send'': undefined method `cache_template_extensions='' for > ActionView::Base:Class (NoMethodError) > > C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:443:in > `load_missing_constant'':NameError: uninitialized constant > ApplicationController > > I see that "cache_template_extensions" defined to ''false'' in > environments/development.rb, so I added to environment.rb > ENV[''RAILS_ENV''] ||= ''development'' just to make sure. (Even though > initializer.rb sets it to ''development'' by default anyway). > > This is latest Ruby 1.8.6 and RoR 2.3.4 on a Windows Vista 64-bit > desktop. > I copied a small project that I was developing on another WinXP machine > here and tried to start WEBrick with ruby script/server. > > The project was originally done under InstantRails, which is based on > RoR 2.0.2. > So I updated to: RAILS_GEM_VERSION = ''2.3.4'' unless defined? > RAILS_GEM_VERSION > > None of this helps. > When I start the console, I get those two messages, but the console > starts. > When I try to start a server (WEBrick), I get this full stack and it > stops. > > c:\Ruby\rails_apps\logbook>ruby script/server > => Booting WEBrick > => Rails 2.3.4 application starting on http://0.0.0.0:3000 > C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:602:in > `send'': undefined method `cache_template_extensions='' for > ActionView::Base:Class (NoMethodError) > from > C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:602:in > `initialize_framework_settings'' > from > C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:601:in > `each'' > from > C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:601:in > `initialize_framework_settings'' > from > C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:598:in > `each'' > from > C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:598:in > `initialize_framework_settings'' > from > C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:155:in > `process'' > from > C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in > `send'' > from > C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in > `run'' > ... 6 levels... > from > C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/commands/server.rb:84 > from > C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > `gem_original_require'' > from > C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > `require'' > from script/server:3 > > ------------------- > > How can I make it work? > > Thank you! > MikeL > -- > 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 -~----------~----~----~----~------~----~------~--~---
Michael Li
2009-Oct-26 04:21 UTC
Re: Rails 2.3.4 - can''t find method `cache_template_extensions''
Conrad Taylor wrote:> Hi, in short, caching is disabled in development mode by default.It''s OK to be disabled for now. Next, you''ll need> to perform the following when changing the RAILS_GEM_VERSION: > > rake rails:update >Below is the trace. The problem is still the same. The only difference is that now the error log of script/console prints only the top exception message, while before it would print first two. The server error log is the same. C:\Ruby\rails_apps\logbook>rake rails:update --trace (in C:/Ruby/rails_apps/logbook) ** Invoke rails:update (first_time) ** Invoke rails:update:scripts (first_time) ** Execute rails:update:scripts install -c -m 0755 C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/tasks/../../bi n/dbconsole script/dbconsole ** Invoke rails:update:javascripts (first_time) ** Execute rails:update:javascripts ** Invoke rails:update:configs (first_time) ** Execute rails:update:configs ** Invoke rails:update:application_controller (first_time) ** Execute rails:update:application_controller C:/Ruby/rails_apps/logbook/app/controllers/application.rb has been renamed to C: /Ruby/rails_apps/logbook/app/controllers/application_controller.rb, update your SCM as necessary ** Execute rails:update Thank you for helping me out... What is happening? Mike -- Posted via http://www.ruby-forum.com/.
Frederick Cheung
2009-Oct-26 08:14 UTC
Re: Rails 2.3.4 - can''t find method `cache_template_extensions''
On Oct 26, 2:57 am, Michael Li <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I''ve come up with an unusual problem right after installing Ruby+RoR. > When I start server or console, I get these two errors: > > C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:602:in > `send'': undefined method `cache_template_extensions='' for > ActionView::Base:Class (NoMethodError) > C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/depen dencies.rb:443:in > `load_missing_constant'':NameError: uninitialized constant > ApplicationController > > I see that "cache_template_extensions" defined to ''false'' in > environments/development.rb, so I added to environment.rb > ENV[''RAILS_ENV''] ||= ''development'' just to make sure. (Even though > initializer.rb sets it to ''development'' by default anyway). >cache_template_extensions is a setting that was removed from rails - you need to stop trying to set it. Another change was that ApplicationController used to be found in application.rb but with 2.3 it is expected to be in application_controller.rb (looks like rake rails:update has done that bit for you) Fred> This is latest Ruby 1.8.6 and RoR 2.3.4 on a Windows Vista 64-bit > desktop. > I copied a small project that I was developing on another WinXP machine > here and tried to start WEBrick with ruby script/server. > > The project was originally done under InstantRails, which is based on > RoR 2.0.2. > So I updated to: RAILS_GEM_VERSION = ''2.3.4'' unless defined? > RAILS_GEM_VERSION > > None of this helps. > When I start the console, I get those two messages, but the console > starts. > When I try to start a server (WEBrick), I get this full stack and it > stops. > > c:\Ruby\rails_apps\logbook>ruby script/server > => Booting WEBrick > => Rails 2.3.4 application starting onhttp://0.0.0.0:3000 > C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:602:in > `send'': undefined method `cache_template_extensions='' for > ActionView::Base:Class (NoMethodError) > from > C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:602:in > `initialize_framework_settings'' > from > C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:601:in > `each'' > from > C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:601:in > `initialize_framework_settings'' > from > C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:598:in > `each'' > from > C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:598:in > `initialize_framework_settings'' > from > C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:155:in > `process'' > from > C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in > `send'' > from > C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in > `run'' > ... 6 levels... > from > C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/commands/server.rb:84 > from > C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > `gem_original_require'' > from > C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > `require'' > from script/server:3 > > ------------------- > > How can I make it work? > > Thank you! > MikeL > -- > Posted viahttp://www.ruby-forum.com/.
Michael Li
2009-Oct-26 08:37 UTC
Re: Rails 2.3.4 - can''t find method `cache_template_extensions''
Frederick Cheung wrote:> On Oct 26, 2:57�am, Michael Li <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: >> I see that "cache_template_extensions" defined to ''false'' in >> environments/development.rb, so I added to environment.rb >> ENV[''RAILS_ENV''] ||= ''development'' just to make sure. (Even though >> initializer.rb sets it to ''development'' by default anyway). >> > cache_template_extensions is a setting that was removed from rails - > you need to stop trying to set it. Another change was that > ApplicationController used to be found in application.rb but with 2.3 > it is expected to be in application_controller.rb (looks like rake > rails:update has done that bit for you) > > FredYes, took it out of development.rb and it worked!! It all makes sense now. Thank you Fred and Conrad. Hope this helps other guys migrating off InstantRails 2.0. With much respect, Michael -- Posted via http://www.ruby-forum.com/.