我有一个带有 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 行。在第 4 行我没有发现任何问题?可能与 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