我正在尝试部署我的RoR应用程序。当RAILS_ENV设置为开发时,它似乎在我的开发机器上正常工作。然而,当我把它在生产服务器上,并将其设置为生产模式导航起始页后,我收到以下错误:液体view_paths错误
=> Booting Mongrel
=> Rails 2.3.8 application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Processing PagesController#show (for 173.79.8.203 at 2010-08-09 20:17:21) [GET]
Parameters: {"slug"=>[], "action"=>"show", "controller"=>"pages"}
NoMethodError (undefined method `view_paths' for #<Liquid::Template:0x7fc6f8b5f8a8>):
Processing ApplicationController#show (for 173.79.8.203 at 2010-08-09 20:17:21) [GET]
Parameters: {"slug"=>[], "action"=>"show", "controller"=>"pages"}
NoMethodError (undefined method `view_paths' for #<Liquid::Template:0x7fc6f8b5f8a8>):
Rendering /home/flavorpulse/sites/public.flavorpulse.com/public/500.html (500 Internal Server Error)
怪异的是,在我的开发环境,我得到了类似的输出但我没有被重定向到500.html。我的开发机器上的类似的输出是:
=> Booting Mongrel
=> Rails 2.3.8 application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
SQL (0.1ms) SET NAMES 'utf8'
SQL (0.1ms) SET SQL_AUTO_IS_NULL=0
Processing PagesController#show (for 127.0.0.1 at 2010-08-09 16:07:50) [GET]
Parameters: {"slug"=>[], "action"=>"show", "controller"=>"pages"}
Domain Columns (1.4ms) SHOW FIELDS FROM `domains`
Domain Load (45.8ms) SELECT * FROM `domains` WHERE (`domains`.`domain_name` = 'localhost') LIMIT 1
Account Columns (1.6ms) SHOW FIELDS FROM `accounts`
Account Load (0.8ms) SELECT * FROM `accounts` WHERE (`accounts`.`id` = 1)
CACHE (0.0ms) SELECT * FROM `accounts` WHERE (`accounts`.`id` = 1)
Theme Columns (2.0ms) SHOW FIELDS FROM `themes`
Theme Load (0.8ms) SELECT * FROM `themes` WHERE (`themes`.`id` = 1)
PageTemplate Columns (1.4ms) SHOW FIELDS FROM `page_templates`
PageTemplate Load (0.3ms) SELECT * FROM `page_templates` WHERE (`page_templates`.`name` = 'index') AND (`page_templates`.theme_id = 1) LIMIT 1
CACHE (0.0ms) SELECT * FROM `domains` WHERE (`domains`.`domain_name` = 'localhost') LIMIT 1
CACHE (0.0ms) SELECT * FROM `accounts` WHERE (`accounts`.`id` = 1)
CACHE (0.0ms) SELECT * FROM `accounts` WHERE (`accounts`.`id` = 1)
CACHE (0.0ms) SELECT * FROM `themes` WHERE (`themes`.`id` = 1)
PageLayout Load (0.4ms) SELECT * FROM `page_layouts` WHERE (`page_layouts`.theme_id = 1) LIMIT 1
PageLayout Columns (1.4ms) SHOW FIELDS FROM `page_layouts`
CACHE (0.0ms) SELECT * FROM `domains` WHERE (`domains`.`domain_name` = 'localhost') LIMIT 1
CACHE (0.0ms) SELECT * FROM `accounts` WHERE (`accounts`.`id` = 1)
CACHE (0.0ms) SELECT * FROM `accounts` WHERE (`accounts`.`id` = 1)
Page Load (0.3ms) SELECT * FROM `pages` WHERE (`pages`.`show_in_navigation` = 1) AND (`pages`.account_id = 1)
NoMethodError (undefined method `view_paths' for #<Liquid::Template:0x10337ef98>):
Rendering rescues/layout (internal_server_error)
但是你可以看到主要的区别是在生产服务器上它并不像任何呼叫正在对数据库进行。
更新2010/08/09 17:41 @美国东部时间:
这里是我的控制器代码这说明我不这样做有一个实例变量命名模板什么:
我已经看到张贴,但我没有设定一个实例变量(或在任何范围级别的任何变量命名模板)。我更新了问题以显示我的控制器代码。 – 2010-08-09 21:41:01