我有一個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
顯示,如果這會更有幫助。 我認爲這是一個常見的,簡單的修復錯誤,我只是不知道該怎麼做。
向我們展示導致錯誤的application.js中的行可能會有所幫助。 – sosborn 2012-01-18 03:01:05
這是奇怪的部分,app/assets/javascript/application.js只包含註釋。 – Vasseurth 2012-01-18 03:21:56
你在那個目錄下還有什麼其他的javascript文件? – sosborn 2012-01-18 03:57:22