English 中文(简体)
bundle exec rake resources: 预谋失败的“未预料到” ......
原标题:bundle exec rake assets:precompile fails with `unexpected token`

I m准备将我的铁路3.1仪器投入生产,自Im使用资产管道以来,。 然而,在我尝试时,我发现的错误显然与编纂《财富》有关:

$ bundle exec rake --trace assets:precompile
** Invoke assets:precompile (first_time)
** Execute assets:precompile
/home/adam/.rvm/rubies/ruby-1.9.3-p0/bin/ruby /home/adam/.rvm/gems/[email protected]/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets --trace
** Invoke assets:precompile:all (first_time)
** Execute assets:precompile:all
** Invoke assets:precompile:primary (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Invoke tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:primary
rake aborted!
399: unexpected token at  "/*!u000a * jQuery JavaScript Library v1.7.1u000a * http://jquery.com/u000a *u000a * Copyright 2011, John Resigu000a * Dual licensed under the MIT or GPL Version 2 licenses.u000a * http://jquery.org/licenseu000a *u000a * Includes Sizzle.jsu000a * http://sizzlejs.com/u000a * Copyright 2011, The Dojo Foundationu000a * Released under the MIT, BSD, and GPL Licenses.u000a *u000a * Date: Mon Nov 21 21:11:03 2011 -0500u000a */u000afunction addActiveScaffoldPageToHistory(a,b){if(typeof

[体积]

  (in /data/music/RotC/eventbook/app/assets/javascripts/application.js)
/home/adam/.rvm/gems/[email protected]/gems/json-1.6.4/lib/json/common.rb:148:in `parse 
/home/adam/.rvm/gems/[email protected]/gems/json-1.6.4/lib/json/common.rb:148:in `parse 
/home/adam/.rvm/gems/[email protected]/gems/multi_json-1.0.4/lib/multi_json/engines/json_common.rb:9:in `decode 
/home/adam/.rvm/gems/[email protected]/gems/multi_json-1.0.4/lib/multi_json.rb:76:in `decode 
/home/adam/.rvm/gems/[email protected]/gems/execjs-1.2.13/lib/execjs/external_runtime.rb:61:in `extract_result 
/home/adam/.rvm/gems/[email protected]/gems/execjs-1.2.13/lib/execjs/external_runtime.rb:27:in `block in exec 
/home/adam/.rvm/gems/[email protected]/gems/execjs-1.2.13/lib/execjs/external_runtime.rb:40:in `compile_to_tempfile 
/home/adam/.rvm/gems/[email protected]/gems/execjs-1.2.13/lib/execjs/external_runtime.rb:26:in `exec 

[批量更重]

参看我的<编码>应用。

//= require jquery
//= require jquery_ujs
//= require jquery-ui
//
// N.B. jQuery requires have to come before this:
//= require active_scaffold

使用默认压缩机的Im,即uglifier

I ve发现,如果我改动config.assets.compress to fal in config/environments/production.rb 那么,它会做一些细微的工作,但当然,如果我能想出一种办法,将它保留为<条码>。

I ve look at rake assets:precompile don t work (rails 3.1.1),我不认为它重复,因为错误是未定义的: Unexpected token:营运人(<)

任何想法? 我含糊不清地怀疑 j法中的这些单条编码性质,但我不敢肯定如何证明或否认它们正在造成这一问题。

最佳回答

我的这个议题是:

如果你在铁路3.1环境中使用应用法(js)和/=要求......,铁路将含有<代码><script> .filecontents. </script>。 你们可以通过以发展方式管理你们的网站,并做一个观点——来源——来核实这一点。

如果是not,在实际使用该文字时,可以appear做罚款。 但是, 基本上,你有:<代码><script><script> .filecontents. </script></script>。

然而,当你试图没收这些资产时,在这种汇编过程中,我不知道究竟是什么样子在内部文字中“并”上。

重复检查包括:js文档,如果其中的任何文件都用<条码>和>、文字与“设计”、......和/字母“t”和加以包装,则删除有关标的。

You should see that, in Development, everything still looks fine if you View Page Source. And, when you precompile your assets, the error should go away.

谷歌建议 go-香草固氮,从包括的档案中去除文字包裹,使问题得到解决。

问题回答

这里我是如何gged弄这一点的。

地方管理

寻找它在哪里做饭(在做饭之前的口号是你想要看的档案)。 审视所有要求。

在我的案件中,我有一份在<代码>.js上填满的文件,当时该文档应为:.jsx,而且该文档是固定的。

我有同样的问题。

即便我没有<代码><script>在我的javascript档案中贴上标签, 戴维建议帮助我说了很多!

我得以在我的<条码>应用.js上看到关于外部校准一的评论:

<!- (......)->

这份单一评论打破了我的<条码>彩虹/条码>压缩,我花了很长的时间来发现这一说法,甚至可能认为这是pri。

因此,在开始查阅共同提交文件时对评论的监视,,因为这可能会打破你的压缩。





相关问题
rails collection_select vs. select

collection_select and select Rails helpers: Which one should I use? I can t see a difference in both ways. Both helpers take a collection and generates options tags inside a select tag. Is there a ...

SSL slowness in EC2

We ve deployed our rails app to EC2. In our setup, we have two proxies on small instances behind round-robin DNS. These run nginx load balancers for a dynamically growing and shrinking farm of web ...

Auth-code with A-Za-z0-9 to use in an URL parameter

As part of a web application I need an auth-code to pass as a URL parameter. I am currently using (in Rails) : Digest::SHA1.hexdigest((object_id + rand(255)).to_s) Which provides long strings like : ...

RubyCAS-Client question: Rails

I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?

activerecord has_many :through find with one sql call

I have a these 3 models: class User < ActiveRecord::Base has_many :permissions, :dependent => :destroy has_many :roles, :through => :permissions end class Permission < ActiveRecord::...

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

Text Editor for Ruby-on-Rails

guys which text editor is good for Rubyonrails? i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor? n which one is best an ...

How to get SQL queries for each user where env is production

I’m developing an application dedicated to generate statistical reports, I would like that user after saving their stat report they save sql queries too. To do that I wrote the following module: ...

热门标签