本文介绍了::的ActionView MissingTemplate的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在将mysite部署到VPS之后,我遇到这个运行时错误。请注意,在我的本地机器中,每件事情都可以正常工作。

I am facing this runtime error after deploying mysite to VPS. note that in my local machine every thing is working fine.

当我尝试通过控制器路由访问任何视图时,可以说PostsController#index

when I try to access any view via controller route lets say PostsController#index

我收到了这个错误

Completed 500 Internal Server Error in 3ms
ActionView::MissingTemplate (Missing template posts/index, application/index with {:handlers=>[:builder, :erb], :formats=>[:html], :locale=>[:en]}. Searched in:
"/home//dev..com/releases/20120413023845/app/views"
):
app/controllers/posts_controller.rb:7:in `index'

我以为哈尔是问题的原因,但我还不确定。

I am thinking that haml is the cause of the problem but I am not sure yet.

我添加了haml宝石并捆绑了我的应用程序

I added haml gems and bundled my app

  gem 'haml'
  gem 'haml-rails'

更新:

我将index.html.haml更改为index.html.erb,并对其工作的模板内容进行了评论,但忽略了application.html.haml布局没有错误。

when I changed index.html.haml to index.html.erb and commented the template content it works but it ignored the application.html.haml layout without errors.

我注意到,当cap命令运行时,应用程序没有编译我的hamls

i noticed that the application didnot compile my hamls when cap command run

RAILS_ENV=production RAILS_GROUPS=assets assets:precompile

Compiled application.js  (1ms)  (pid 15420)
Compiled application.css  (1ms)  (pid 15420)
Compiled application.js  (1ms)  (pid 15420)
Compiled application.css  (1ms)  (pid 15420) 

这是否意味着我有资产管道管理的哈姆变换器有问题?如何在生产环境中告诉铁杆处理哈姆勒。

does this mean I have problem with haml converter that is managed by the asset pipeline? how can I tell rails to handle haml in the production environment.

这是我的生产宝石版本

Using rake (0.9.2.2) 
Using i18n (0.6.0) 
Using multi_json (1.2.0) 
Using activesupport (3.2.3) 
Using builder (3.0.0) 
Using activemodel (3.2.3) 
Using erubis (2.7.0) 
Using journey (1.0.3) 
Using rack (1.4.1) 
Using rack-cache (1.2) 
Using rack-test (0.6.1) 
Using hike (1.2.1) 
Using tilt (1.3.3) 
Using sprockets (2.1.2) 
Using actionpack (3.2.3) 
Using mime-types (1.18) 
Using polyglot (0.3.3) 
Using treetop (1.4.10) 
Using mail (2.4.4) 
Using actionmailer (3.2.3) 
Using arel (3.0.2) 
Using tzinfo (0.3.33) 
Using activerecord (3.2.3) 
Using activeresource (3.2.3) 
Using highline (1.6.11) 
Using net-ssh (2.3.0) 
Using net-scp (1.0.4) 
Using net-sftp (2.0.5) 
Using net-ssh-gateway (1.1.0) 
Using capistrano (2.11.2) 
Using chunky_png (1.2.5) 
Using coffee-script-source (1.3.1) 
Using execjs (1.3.0) 
Using coffee-script (2.2.0) 
Using rack-ssl (1.3.2) 
Using json (1.6.6) 
Using rdoc (3.12) 
Using thor (0.14.6) 
Using railties (3.2.3) 
Using coffee-rails (3.2.2) 
Using fssm (0.2.9) 
Using sass (3.1.15) 
Using compass (0.12.1) 
Using compass-rails (1.0.1) 
Using haml (3.1.4) 
Using haml-rails (0.3.4) 
Using hpricot (0.8.6) 
Using mysql2 (0.3.11) 
Using bundler (1.1.3) 
Using rails (3.2.3) 
Using sexp_processor (3.1.0) 
Using ruby_parser (2.3.1) 
Using sass-rails (3.2.5) 
Using uglifier (1.2.4) 


推荐答案

可能是您的

gem 'haml'

不在生产组(或不在开发组之外)

is not in production group (or, is not outside the development group)

这篇关于::的ActionView MissingTemplate的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 22:41