English 中文(简体)
购物. 预制资产
原标题:config.assets.precompile not adding vendor/gem assets

我在把供应商化的资产编成基本档案方面遇到困难。

我想有以下资产可以独立(没有与其他资产合并):

vendor/gems/neo-viz/app/assets/stylesheets/neo-viz.css.scss
vendor/gems/neo-viz/app/assets/javascripts/neo-viz.js.coffee
vendor/gems/neo-viz/app/assets/javascripts/lib/jQuery/jquery-1.6.1.min.js
vendor/gems/neo-viz/app/assets/javascripts/lib/arbor/arbor.js

内容如下:

config.assets.precompile += %w( jquery-1.6.1.min.js arbor.js neo-viz.js neo-viz.css )

只有案卷预先整理并公布。 为什么?

此外,在看到这一问题后()。 将资产列入有星号的子公司。

config.assets.precompile += %w( jquery-1.6.1.min.js arbor.js neo-viz.js neo-viz.css lib/arbor/arbor.js arbor/arbor.js lib/jQuery/jquery-1.6.1.min.js jQuery/jquery-1.6.1.min.js   )

但它没有改变。 想法?

问题回答

违约铁路只看3个地点:<代码>app/assets,lib/assetsvendor/assets。 Sprockets在子标题javascripts中查看共同财产。 E.g.

app/assets/javascripts/arbor.js
lib/assets/javascripts/arbor.js
vendor/assets/javascripts/arbor.js

如果你想看到铁路在哪里找你,就能够在ole里使用:Rails.application.config.assets.paths

你们可以做的是,在管道上增加你的习俗:

 # @file: config/application.rb
 config.assets.paths << Rails.root.join("vendor", "gems", "neo-viz", "app", "assets", "javascripts")

之后,在你包括贵方共同提交文件的地方,就形成了一份清单:

# @file: /vendor/gems/neo-viz/app/assets/javascripts/neo-viz.js
//= require lib/jQuery/jquery-1.6.1.min
//= require lib/arbor/arbor
//= require neo-viz

最后,添加以下内容:

config.assets.precompile += %w( neo-viz.js ) 

如果你仍然想把他们分开,我看不到这一点,为什么不把他们列入一个表象,那么你就不得不增加<>all。 (a) 可能的道路,例如铁路,在什么地方可以发现:

 # @file: config/application.rb
 config.assets.paths << Rails.root.join("vendor", "gems", "neo-viz", "app", "assets", "stylesheets")
 config.assets.paths << Rails.root.join("vendor", "gems", "neo-viz", "app", "assets", "javascripts")
 config.assets.paths << Rails.root.join("vendor", "gems", "neo-viz", "app", "assets", "javascripts", "lib", "jQuery")
 config.assets.paths << Rails.root.join("vendor", "gems", "neo-viz", "app", "assets", "javascripts", "lib", "arbor")

然后,你可以补充这些资产,因为必须把表面外的资产添加到comp积阵列中:

config.assets.precompile += %w( jquery-1.6.1.min.js arbor.js neo-viz.js neo-viz.css )

资料来源:。 资产组织





相关问题
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: ...

热门标签