0

我收到此错误:

Sprockets::Helpers::RailsHelper::AssetPaths::AssetNotPrecompiledError in Main#index

Showing /etc/apache2/CrawlFish/app/views/layouts/application.html.erb where line #15 raised:

jquery-ui-1.8.20.custom.min isn't precompiled

在 config/environements/production.rb 中,我添加了这一行:

config.assets.precompile += %w( jquery-ui-1.8.20.custom.min.js )

即使在这样做之后,我也收到上述预编译错误。在 public/assets/manifest.yml 中,没有 jquery-ui-1.8.20.custom.min.js 文件的条目。但是在公共/资产中,会生成以下文件:

jquery-ui-1.8.20.custom.min-3ef66af7d5b20341b5fceb4ad1b2755f.js
jquery-ui-1.8.20.custom.min-3ef66af7d5b20341b5fceb4ad1b2755f.js.gz
jquery-ui-1.8.20.custom.min.js
jquery-ui-1.8.20.custom.min.js.gz

如何解决这个问题?

4

1 回答 1

1

你有没有像这样 jquery-ui 添加你的 jquery-ui

//= require jquery
//= require jquery-ui
//= require jquery_ujs

你为什么这样称呼它?

config.assets.precompile += %w( jquery-ui-1.8.20.custom.min.js )

如果它在资产文件夹中,您应该没有任何问题。

您的 application.rb 上是否有以下代码

config.assets.initialize_on_precompile = false

我可能错了,但我会尝试

于 2012-06-10T17:38:51.490 回答