Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.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 3 Heroku在线上的语法错误,该行不';不存在_Ruby On Rails 3_Heroku - Fatal编程技术网

Ruby on rails 3 Heroku在线上的语法错误,该行不';不存在

Ruby on rails 3 Heroku在线上的语法错误,该行不';不存在,ruby-on-rails-3,heroku,Ruby On Rails 3,Heroku,我有一个带有Haml视图的Rails应用程序,它在本地和其他主机上运行良好。但部署到Heroku后,第一个请求会出现错误,请参阅下面的日志: Started GET "/" for 88.159.5.1 at 2012-11-02 07:03:56 +0000 - - Processing by SessionsController#new as HTML - - Rendered sessions/new.html.haml within layouts/application (403.5m

我有一个带有Haml视图的Rails应用程序,它在本地和其他主机上运行良好。但部署到Heroku后,第一个请求会出现错误,请参阅下面的日志:

Started GET "/" for 88.159.5.1 at 2012-11-02 07:03:56 +0000
- - Processing by SessionsController#new as HTML
- - Rendered sessions/new.html.haml within layouts/application (403.5ms)
- - Completed 500 Internal Server Error in 497ms
- - ActionView::Template::Error (syntax error on line 18, col 4: `all:  all'):                                      
- -     1: .sixteen.columns
- -     2:   #loginblock
- -     3:     .content_title.general
- -     4:     %h2= I18n.t :login_title
- -     5:     .content
- -     6:       = render("layouts/message")
- -     7:       = form_tag(sessions_path, :class => 'form') do
- -   app/views/sessions/new.html.haml:4:in `_app_views_sessions_new_html_haml___1472882735787050115_50827800'
奇怪的是:第18行在那个视图中并不存在,它只有17行。在第四行,我没有发现任何问题?可能与Haml或Haml gem工作不正常有关?请参见下面的视图文件。谢谢你的意见

.sixteen.columns
  #loginblock
    .content_title.general
    %h2= I18n.t :login_title
    .content
      = render("layouts/message")
      = form_tag(sessions_path, :class => 'form') do
        .field
          = label_tag I18n.t :form_email
          = text_field_tag :email
        .field
          = label_tag I18n.t :form_password
          = password_field_tag :password
        .field
          = submit_tag I18n.t(:login_title), :class => 'button white'
        .clear

找到了:yaml文件中的缩进是4个空格,而不是2个,所以级别太深了。出于某种原因,我的本地Rails安装程序接受这一点,但Heroku Rails安装程序不接受。因此,在更正缩进后,Heroku上的一切都正常。

我发现语法错误来自I18n yml文件。注释文件可以解决错误,但为什么会失败?