tags:

views:

242

answers:

2

I'm migrating some websites over to another server. One of the websites is built with Ruby Enterprise Edition and Passenger. I'm trying to make the website run on Ubuntu 9.10, Apache 2 and mysql 5. I've never worked with ruby or ruby on rails before.

When I go to the website built with ruby, I get an error. I've attached a copy of the error log that shows up at the end of this question. Can anyone guess at what might be wrong with my installation and how I can fix it?

These are the possible causes:

*
There may be a syntax error in the application's code. Please check for such errors and fix them.
*
A required library may not installed. Please install all libraries that this application requires.
*
The application may not be properly configured. Please check whether all configuration files are written correctly, fix any incorrect configurations, and restart this application.
*
A service that the application relies on (such as the database server or the Ferret search engine server) may not have been started. Please start that service.

Further information about the error may have been written to the application's log file. Please check it in order to analyse the problem.

Error message:
undefined method `register_template_handler' for ActionView::Base:Class (NoMethodError)
Exception class:
PhusionPassenger::UnknownError
Application root:
/var/www/current 
Backtrace:
#   File    Line    Location
0   /var/www/current/vendor/plugins/markaby/init.rb     6   in `evaluate_init_rb'
1   /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/plugin.rb   158     in `evaluate_init_rb'
2   /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/kernel/reporting.rb   11  in `silence_warnings'
3   /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/plugin.rb   154     in `evaluate_init_rb'
4   /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/plugin.rb   48  in `load'
5   /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/plugin/loader.rb    38  in `load_plugins'
6   /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/plugin/loader.rb    37  in `each'
7   /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/plugin/loader.rb    37  in `load_plugins'
8   /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb    369     in `load_plugins'
9   /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb    165     in `process'
10  /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb    113     in `send'
11  /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb    113     in `run'
12  /var/www/current/config/environment.rb  10  
13  /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb    31  in `gem_original_require'
14  /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb    31  in `require'
15  /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/railz/application_spawner.rb   303     in `preload_application'
16  /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/railz/application_spawner.rb   252     in `initialize_server'
17  /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/utils.rb   255     in `report_app_init_status'
18  /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/railz/application_spawner.rb   237     in `initialize_server'
19  /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/abstract_server.rb     194     in `start_synchronously'
20  /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/abstract_server.rb     163     in `start'
21  /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/railz/application_spawner.rb   213     in `start'
22  /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/spawn_manager.rb   262     in `spawn_rails_application'
23  /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/abstract_server_collection.rb  126     in `lookup_or_add'
24  /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/spawn_manager.rb   256     in `spawn_rails_application'
25  /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/abstract_server_collection.rb  80  in `synchronize'
26  /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/abstract_server_collection.rb  79  in `synchronize'
27  /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/spawn_manager.rb   255     in `spawn_rails_application'
28  /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/spawn_manager.rb   154     in `spawn_application'
29  /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/spawn_manager.rb   287     in `handle_spawn_application'
30  /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/abstract_server.rb     352     in `__send__'
31  /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/abstract_server.rb     352     in `main_loop'
32  /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11/lib/phusion_passenger/abstract_server.rb     196     in `start_synchronously'
33  /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11/bin/passenger-spawn-server   61  
A: 
undefined method `register_template_handler' for ActionView::Base:Class (NoMethodError)

Quick google for 'register_template_handler' gave this : https://rails.lighthouseapp.com/projects/8994/tickets/187-actionview-register_template_handler-missing-in-2-1-rc-1 and this http://www.redmine.org/boards/2/topics/3376 and this http://www.tsfsc.com/blog/

Tuomas Pelkonen
+1  A: 

I had to make sure I installed all the right gems, which means they must all be the correct version, many of which are old.

John