我有以下代码,我尝试用coffeescript编写。
$.ajax {
type: 'GET'
url: '/dashboard'
success: (response) ->
$('.loading_row').remove()
dataType: 'script'
}
每次我尝试运行此收到以下错误信息:
Assertion failed: (0 && "implement me"), function uv_fs_readlink, file src/unix/fs.c, line 613.
我可以把成功回调都在同一行解决这一点,但我想调用多个方法回调,所以这是行不通的。
$.ajax {
type: 'GET'
url: '/dashboard'
success: (response) -> $('.loading_row').remove()
dataType: 'script'
}
你必须更多地设置它......这看起来像jQuery,但是你得到的错误来自'c'文件。所以你在Node.js下运行它,对吧?使用'$ = require'jquery''并且您正在使用[jsdom](https://github.com/tmpvar/jsdom),以使'.remove()'行有意义? –
它在Rails 3.1下运行,jquery已被包含,并且该文件中的其他jquery行可以正常工作。不使用jsdom。 – Jeremy
好的...所以你在编译时看到这个错误?那么ExecJS使用的JavaScript环境可能会有问题。尝试将'therubyracer'添加到您的Gemfile并运行'bundle install'。 –