我有一个Rails 3.1应用程序,我正在尝试将其推送到Heroku。虽然推送成功了,但当它尝试rake资产时出现错误。它会得到一个错误。
Unexpected token punc, expected punc (line: 11225, col: 7, pos: 321149)
undefined
(in /Users/Matt/Orchive/Orchive/app/assets/javascripts/application.js)
然而,这个application.js文件只包含一些注释。以下是它的内容:
// This is a manifest file that'll be compiled into including all the files listed below.
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
// be included in the compiled file accessible from http://example.com/assets/application.js
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
//= require jquery
//= require jquery_ujs
//= require_tree
我不是很理解什么是资产,但我在推送之前在终端中尝试运行rake assets:precompile
,结果得到了一个大错误。
/Users/Matt/.rvm/rubies/ruby-1.9.2-p180/bin/ruby /Users/Matt/.rvm/gems/ruby-1.9.2-p180/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
rake aborted!
Unexpected token punc, expected punc (line: 11225, col: 7, pos: 321149)
undefined
(in /Users/Matt/Orchive/Orchive/app/assets/javascripts/application.js)
Tasks: TOP => assets:precompile:primary
(See full trace by running task with --trace)
rake aborted!
Command failed with status (1): [/Users/Matt/.rvm/rubies/ruby-1.9.2-p180/bi...]
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
如果使用--trace
会更有帮助的话,我可以编辑这个并将其更改为所显示的内容。我认为这是一个常见且容易修复的错误,只是我不知道该怎么做。