1

我一直在安装spree,作为安装的一部分,运行了以下命令:

rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets

然后我得到这个错误:

rake aborted!
TypeError: Cannot call method 'write' of undefined
at /tmp/execjs20120526-15139-1ixqp7s.js:6290:20
at /tmp/execjs20120526-15139-1ixqp7s.js:6304:16
at /tmp/execjs20120526-15139-1ixqp7s.js:1:92
at Object.<anonymous> (/tmp/execjs20120526-15139-1ixqp7s.js:1:109)
at Module._loadContent (node.js:667:21)
at node.js:695:20
at node.js:304:23
at node.js:756:9

(在 /app/assets/javascripts/admin/all.js 中)

这是堆栈跟踪:

/usr/local/rvm/gems/ruby-1.9.3-p125@happyBirthday/gems/execjs-
1.4.0/lib/execjs/external_runtime.rb:142:in `exec_runtime'
/usr/local/rvm/gems/ruby-1.9.3-p125@happyBirthday/gems/execjs-1.4.0/lib/execjs/external_runtime.rb:28:in `block in exec'
/usr/local/rvm/gems/ruby-1.9.3-p125@happyBirthday/gems/execjs-1.4.0/lib/execjs/external_runtime.rb:41:in `compile_to_tempfile'
/usr/local/rvm/gems/ruby-1.9.3-p125@happyBirthday/gems/execjs-1.4.0/lib/execjs/external_runtime.rb:27:in `exec'
/usr/local/rvm/gems/ruby-1.9.3-p125@happyBirthday/gems/uglifier-1.2.4/lib/uglifier.rb:101:in `compile'
/usr/local/rvm/gems/ruby-1.9.3-p125@happyBirthday/gems/actionpack-3.2.3/lib/sprockets/compressors.rb:74:in `compress'
/usr/local/rvm/gems/ruby-1.9.3-p125@happyBirthday/gems/sprockets-2.1.3/lib/sprockets/processing.rb:265:in `block in js_compressor='
/usr/local/rvm/gems/ruby-1.9.3-p125@happyBirthday/gems/sprockets-2.1.3/lib/sprockets/processor.rb:29:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p125@happyBirthday/gems/sprockets-2.1.3/lib/sprockets/processor.rb:29:in `evaluate'
/usr/local/rvm/gems/ruby-1.9.3-p125@happyBirthday/gems/tilt-1.3.3/lib/tilt/template.rb:76:in `render'
/usr/local/rvm/gems/ruby-1.9.3-p125@happyBirthday/gems/sprockets-2.1.3/lib/sprockets/context.rb:177:in `block in evaluate'
/usr/local/rvm/gems/ruby-1.9.3-p125@happyBirthday/gems/sprockets-2.1.3/lib/sprockets/context.rb:174:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p125@happyBirthday/gems/sprockets-2.1.3/lib/sprockets/context.rb:174:in `evaluate'
/usr/local/rvm/gems/ruby-1.9.3-p125@happyBirthday/gems/sprockets-2.1.3/lib/sprockets/bundled_asset.rb:26:in `initialize'
/usr/local/rvm/gems/ruby-1.9.3-p125@happyBirthday/gems/sprockets-2.1.3/lib/sprockets/base.rb:244:in `new'
/usr/local/rvm/gems/ruby-1.9.3-p125@happyBirthday/gems/sprockets-2.1.3/lib/sprockets/base.rb:244:in `build_asset'
/usr/local/rvm/gems/ruby-1.9.3-p125@happyBirthday/gems/sprockets-2.1.3/lib/sprockets/index.rb:89:in `block in build_asset'
/usr/local/rvm/gems/ruby-1.9.3-p125@happyBirthday/gems/sprockets-2.1.3/lib/sprockets/caching.rb:19:in `cache_asset'
/usr/local/rvm/gems/ruby-1.9.3-p125@happyBirthday/gems/sprockets-2.1.3/lib/sprockets/index.rb:88:in `build_asset'
/usr/local/rvm/gems/ruby-1.9.3-p125@happyBirthday/gems/sprockets-2.1.3/lib/sprockets/base.rb:163:in `find_asset'
/usr/local/rvm/gems/ruby-1.9.3-p125@happyBirthday/gems/sprockets-2.1.3/lib/sprockets/index.rb:56:in `find_asset'
/usr/local/rvm/gems/ruby-1.9.3-p125@happyBirthday/gems/actionpack-3.2.3/lib/sprockets/static_compiler.rb:20:in `block in compile'
/usr/local/rvm/gems/ruby-1.9.3-p125@happyBirthday/gems/sprockets-2.1.3/lib/sprockets/base.rb:212:in `block in each_logical_path'
/usr/local/rvm/gems/ruby-1.9.3-p125@happyBirthday/gems/sprockets-2.1.3/lib/sprockets/base.rb:200:in `block (2 levels) in each_file'
/usr/local/rvm/gems/ruby-1.9.3-p125@happyBirthday/gems/sprockets-2.1.3/lib/sprockets/base.rb:190:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p125@happyBirthday/gems/sprockets-2.1.3/lib/sprockets/base.rb:190:in `each_entry'
/usr/local/rvm/gems/ruby-1.9.3-p125@happyBirthday/gems/sprockets-2.1.3/lib/sprockets/base.rb:198:in `block in each_file'
/usr/local/rvm/gems/ruby-1.9.3-p125@happyBirthday/gems/sprockets-2.1.3/lib/sprockets/base.rb:197:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p125@happyBirthday/gems/sprockets-2.1.3/lib/sprockets/base.rb:197:in `each_file'
/usr/local/rvm/gems/ruby-1.9.3-p125@happyBirthday/gems/sprockets-2.1.3/lib/sprockets/base.rb:210:in `each_logical_path'
/usr/local/rvm/gems/ruby-1.9.3-p125@happyBirthday/gems/actionpack-3.2.3/lib/sprockets/static_compiler.rb:18:in `compile'
/usr/local/rvm/gems/ruby-1.9.3-p125@happyBirthday/gems/actionpack-3.2.3/lib/sprockets/assets.rake:56:in `internal_precompile'
/usr/local/rvm/gems/ruby-1.9.3-p125@happyBirthday/gems/actionpack-3.2.3/lib/sprockets/assets.rake:70:in `block (3 levels) in <top (required)>'
/usr/local/rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/usr/local/rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/usr/local/rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/usr/local/rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/usr/local/rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/usr/local/rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/usr/local/rvm/gems/ruby-1.9.3-p125@happyBirthday/gems/actionpack-3.2.3/lib/sprockets/assets.rake:60:in `block (3 levels) in <top (required)>'
/usr/local/rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/usr/local/rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/usr/local/rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/usr/local/rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/usr/local/rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/usr/local/rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/usr/local/rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/usr/local/rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/usr/local/rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/usr/local/rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/usr/local/rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/usr/local/rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/usr/local/rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/usr/local/rvm/gems/ruby-1.9.3-p125@global/bin/rake:19:in `load'
/usr/local/rvm/gems/ruby-1.9.3-p125@global/bin/rake:19:in `<main>'
Tasks: TOP => assets:precompile:primary

我查看了 all.js - 文件中有一些被注释掉的东西,就是这样。这也是全新的安装......

我正在运行 rake (0.9.2.2)、rails (3.2.3)、ruby 1.9.3p125

知道发生了什么吗?谢谢你的帮助!

4

1 回答 1

0

我在我的设置中遇到了这个问题,这是因为我在我的 CSS 中粘贴了一些无效的媒体查询。哦!

于 2012-07-13T11:04:19.677 回答