2

我正在尝试在 Rails 应用程序(在 Cygwin、Win7 下)上运行 coffescript 代码,并且我有以下错误日志:

ActionView::Template::Error (
module.js:340
    throw err;
          ^
Error: Cannot find module 'C:\tmp\execjs20130227-4044-6cws3p.js'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.runMain (module.js:492:10)
    at process.startup.processNextTick.process._tickCallback (node.js:244:9)

  (in /cygdrive/c/Users/IBM_ADMIN/Programming/Rails/AdmApp/app/assets/javascripts/aplicacao.js.coffee)):
    3: <head>
    4:   <title>AdmApp</title>
    5:   <%= stylesheet_link_tag    "application", :media => "all" %>
    6:   <%= javascript_include_tag "application" %>
    7:   <%= csrf_meta_tag %>
    8: </head>
    9: <body>
  app/views/layouts/application.html.erb:6:in `_app_views_layouts_application_html_erb__1024687483__1068178198'


  Rendered /usr/lib/ruby/gems/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1)
  Rendered /usr/lib/ruby/gems/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/templates/rescues/_request_and_onse.erb (1.0ms)
  Rendered /usr/lib/ruby/gems/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/templates/rescues/template_errob within rescues/layout (81.0ms)

我的咖啡脚本在 aplicacao.js.coffee 上:

jQuery ->
  $('#states').sortable(
    axis: 'y'
    update: ->
      alert('updated!')
  );

任何想法?Tks

4

1 回答 1

1

在这里看起来像是一组混合路径。我看到了 dos 风格C:\tmp\execjs20130227-4044-6cws3p.js和 cygwin (unix) 风格:/cygdrive/c/Users/IBM_ADMIN/Programming/Rails/...

看起来该应用程序正在 Cygwin 中运行,所以我将所有路径更改为 unix 样式并重试。

于 2013-02-27T18:29:53.670 回答