[英]How to get 3.1 rails assets working in mod_rails?
嘗試從rails server
切換到Apache和Passenger。 我在日志中遇到一個找不到資產的錯誤,發現我需要進行rake assets:precompile
。 當這樣做時(清潔后),我得到以下消息。 預編譯和rails server
之間可能在前者中產生此類錯誤的區別是什么?
$ rake assets:precompile --trace
** Invoke assets:precompile (first_time)
** Execute assets:precompile
rake aborted!
Unexpected token: operator (>) (line: 9398, col: 3, pos: 252073)
TypeError: object is not a function
at Object.CALL_NON_FUNCTION (native)
at new JS_Parse_Error (/tmp/execjs20110913-10691-16kuf4b.js:463:20)
at js_error (/tmp/execjs20110913-10691-16kuf4b.js:474:15)
at croak (/tmp/execjs20110913-10691-16kuf4b.js:926:49)
at token_error (/tmp/execjs20110913-10691-16kuf4b.js:930:45)
at unexpected (/tmp/execjs20110913-10691-16kuf4b.js:936:84)
at /tmp/execjs20110913-10691-16kuf4b.js:1304:17
at maybe_unary (/tmp/execjs20110913-10691-16kuf4b.js:1389:27)
at expr_op (/tmp/execjs20110913-10691-16kuf4b.js:1409:45)
at expr_ops (/tmp/execjs20110913-10691-16kuf4b.js:1416:24)
(in /home/user/locator/app/assets/javascripts/application.js)
Tasks: TOP => assets:precompile
使用Rails服務器,js文件將僅由webrick提供。
使用asset:precompile進行連接和壓縮。 為此,需要對其進行分析,並且其中包含錯誤。 在開發模式下,相同的錯誤並不那么糟糕,因為它只是意味着JS加載此時已停止。 如果您處於資產調試模式,則它甚至僅影響特定文件。
我將在9398行中查看已編譯的應用程序JS,看看是否存在語法錯誤,如果有,請在源文件中找到它。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.