Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/62.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails application.html.haml未呈现_Ruby On Rails_Haml_Erb - Fatal编程技术网

Ruby on rails application.html.haml未呈现

Ruby on rails application.html.haml未呈现,ruby-on-rails,haml,erb,Ruby On Rails,Haml,Erb,我使用的是rails版本3.2.12,并且在我的视图中使用了.erb模板 现在我想开始使用haml模板 我在gem文件中添加了haml和haml-rails,并安装了这个包 Using haml (4.0.0) Installing haml-rails (0.4) 我已经制作了一个模拟应用程序。html.haml !!! 5 %html %head %title Rotten Potatoes! = stylesheet_link_tag 'application'

我使用的是rails版本3.2.12,并且在我的视图中使用了.erb模板

现在我想开始使用haml模板

我在gem文件中添加了haml和haml-rails,并安装了这个包

Using haml (4.0.0) 
Installing haml-rails (0.4) 
我已经制作了一个模拟应用程序。html.haml

!!! 5
%html
  %head
    %title Rotten Potatoes!
    = stylesheet_link_tag 'application'
    = javascript_include_tag 'application'
    = csrf_meta_tags

  %body
    = yield
然后,我将应用程序_controller.rb更改为

class ApplicationController < ActionController::Base
  layout "application"
  protect_from_forgery
  include SessionsHelper
end
class ApplicationController
运行此操作时,我会收到以下错误消息: 缺少具有{:locale=>[:en],:formats=>[:html],:handlers=>[:erb,:builder,:coffee]}的模板布局/应用程序。搜索位置:“//主页/科恩/桌面/rails\u项目/示例\u应用程序/应用程序/视图”

似乎没有安装haml处理程序


我怎样才能做到这一点呢?

那么,您重新启动了开发服务器了吗?将gem添加到Gemfile之后,这是一件非常重要的事情

顺便说一句,我一直使用haml,我从来没有使用过“haml rails”


当我开始新项目时,我唯一要做的就是将“gem'haml'”添加到Gemfile中,一切都像它应该工作的那样工作。

argh,当我自己能够想到答案时,我讨厌它:)谢谢一个捆绑伙伴!