3

我正在本地开发一个曾经完美运行的应用程序。但是现在,我在连接到我的localhost. 我用devise-2.2.3宝石

Started GET "/users/sign_in" for 127.0.0.1 at 2013-08-12 16:54:42 +0200
Creating scope :closed. Overwriting existing method MergeRequest.closed.
Processing by Devise::SessionsController#new as HTML
  Rendered devise/sessions/new.html.haml within layouts/devise (1.8ms)
  Rendered layouts/_head.html.haml (26.1ms)
Completed 500 Internal Server Error in 59ms

我注意到没有layouts/_head.html.haml。那么有人知道这种错误的起源吗?

正如建议的那样,我发布了完整的堆栈,但我认为它的信息量并不比我之前发布的内容多;)

Started GET "/users/sign_in" for 127.0.0.1 at 2013-08-12 17:16:27 +0200
Processing by Devise::SessionsController#new as HTML
  Rendered devise/sessions/new.html.haml within layouts/devise (1.8ms)
  Rendered layouts/_head.html.haml (88.1ms)
Completed 500 Internal Server Error in 94ms

ActionView::Template::Error (SyntaxError: unexpected IDENTIFIER
  (in /Users/git/gitlab/app/assets/javascripts/application.js.coffee)):
    5:     GitLab
    6:   = favicon_link_tag 'favicon.ico'
    7:   = stylesheet_link_tag    "application"
    8:   = javascript_include_tag "application", "internationalization.js", "http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"
    9:   = csrf_meta_tags
    10:   = include_gon
    11: 
  app/views/layouts/_head.html.haml:8:in `_app_views_layouts__head_html_haml__3074448813358061809_70101269487200'
  app/views/layouts/devise.html.haml:3:in `_app_views_layouts_devise_html_haml__1317746148502442303_70101202019240'


Started GET "/static.css" for 127.0.0.1 at 2013-08-12 17:16:28 +0200
Processing by ProjectsController#show as HTML
  Parameters: {"id"=>"static.css"}
Completed 401 Unauthorized in 0ms
Started GET "/users/sign_in" for 127.0.0.1 at 2013-08-12 17:16:28 +0200
Processing by Devise::SessionsController#new as HTML
  Rendered devise/sessions/new.html.haml within layouts/devise (1.9ms)
  Rendered layouts/_head.html.haml (25.9ms)
Completed 500 Internal Server Error in 32ms

ActionView::Template::Error (SyntaxError: unexpected IDENTIFIER
  (in /Users/git/gitlab/app/assets/javascripts/application.js.coffee)):
    5:     GitLab
    6:   = favicon_link_tag 'favicon.ico'
    7:   = stylesheet_link_tag    "application"
    8:   = javascript_include_tag "application", "internationalization.js", "http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"
    9:   = csrf_meta_tags
    10:   = include_gon
    11: 
  app/views/layouts/_head.html.haml:8:in `_app_views_layouts__head_html_haml__3074448813358061809_70101269487200'
  app/views/layouts/devise.html.haml:3:in `_app_views_layouts_devise_html_haml__1317746148502442303_70101202019240'


Started GET "/favicon.ico" for 127.0.0.1 at 2013-08-12 17:16:28 +0200
Processing by ProjectsController#show as */*
  Parameters: {"id"=>"favicon.ico"}
Completed 401 Unauthorized in 0ms
Started GET "/users/sign_in" for 127.0.0.1 at 2013-08-12 17:16:28 +0200
Processing by Devise::SessionsController#new as */*
  Rendered devise/sessions/new.html.haml within layouts/devise (1.8ms)
  Rendered layouts/_head.html.haml (27.2ms)
Completed 500 Internal Server Error in 33ms

ActionView::Template::Error (SyntaxError: unexpected IDENTIFIER
  (in /Users/git/gitlab/app/assets/javascripts/application.js.coffee)):
    5:     GitLab
    6:   = favicon_link_tag 'favicon.ico'
    7:   = stylesheet_link_tag    "application"
    8:   = javascript_include_tag "application", "internationalization.js", "http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"
    9:   = csrf_meta_tags
    10:   = include_gon
    11: 
  app/views/layouts/_head.html.haml:8:in `_app_views_layouts__head_html_haml__3074448813358061809_70101269487200'
  app/views/layouts/devise.html.haml:3:in `_app_views_layouts_devise_html_haml__1317746148502442303_70101202019240'


Started GET "/favicon.ico" for 127.0.0.1 at 2013-08-12 17:16:28 +0200
Processing by ProjectsController#show as */*
  Parameters: {"id"=>"favicon.ico"}
Completed 401 Unauthorized in 0ms
Started GET "/users/sign_in" for 127.0.0.1 at 2013-08-12 17:16:28 +0200
Processing by Devise::SessionsController#new as */*
  Rendered devise/sessions/new.html.haml within layouts/devise (1.8ms)
  Rendered layouts/_head.html.haml (25.0ms)
Completed 500 Internal Server Error in 31ms

ActionView::Template::Error (SyntaxError: unexpected IDENTIFIER
  (in /Users/git/gitlab/app/assets/javascripts/application.js.coffee)):
    5:     GitLab
    6:   = favicon_link_tag 'favicon.ico'
    7:   = stylesheet_link_tag    "application"
    8:   = javascript_include_tag "application", "internationalization.js", "http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"
    9:   = csrf_meta_tags
    10:   = include_gon
    11: 
  app/views/layouts/_head.html.haml:8:in `_app_views_layouts__head_html_haml__3074448813358061809_70101269487200'
  app/views/layouts/devise.html.haml:3:in `_app_views_layouts_devise_html_haml__1317746148502442303_70101202019240'
4

1 回答 1

1

好吧,布局不是您的问题(我不认为),当发布堆栈溢出错误时,发布堆栈跟踪非常重要。

堆栈跟踪是保存有关错误的所有知识的圣杯,没有它,我们完全迷失了方向。发布堆栈跟踪,并尝试重新启动您的 Rails 服务器。确保您迁移数据库,然后也许我们可以修复错误。

这一行:

= javascript_include_tag "application", "internationalization.js", "http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"

被打破。

我不知道为什么,可能是因为您在同一行列出了 JS 文件。javascript文件本身可能存在问题,不确定,但这就是错误所在。

于 2013-08-12T15:11:40.837 回答