[英]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.