本文介绍了fitvids正在开发中加载,但无法在heroku上进行预编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用jquery.fitvids插件.我的application.js包括

I am using the jquery.fitvids plugin. My application.js includes

//= require jquery-placeholder
//= require fitvids
//= require flexslider
//= require js-cookie

我正在使用bower-rails来管理jquery插件,因此jquery.fitvids.js被存储在vendor/assets/bower_components/fitvids下.在开发中,fitvids可以负载并正常工作.当我尝试推送到heroku时,出现以下错误:

I am using bower-rails to manage the jquery plugins so the jquery.fitvids.js is stored under vendor/assets/bower_components/fitvids. In development, fitvids loads and works. When I try to push to heroku, I get the following error:

-----> Preparing app for Rails asset pipeline
remote:        Running: rake assets:precompile
remote:        rake aborted!
remote:        Sprockets::FileNotFound: couldn't find file 'fitvids'
remote:        (in /tmp/build_d90a6809ebf196379ed83d88b9390b57/app/assets/javascripts/application.js:8)
remote:        /tmp/build_d90a6809ebf196379ed83d88b9390b57/vendor/bundle/ruby/2.1.0/gems/sprockets-2.12.4/lib/sprockets/context.rb:106:in `resolve'

如果我从application.js中删除了require fitvids指令,那么即使jquery.flexslider.js位于vendor/assets/bower_components/flexslider下,资产也会进行预编译.我能看到的唯一实质性区别是,还有另外一个缩小版的flexslider,但没有fitvids.

If I take the require fitvids directive out of application.js then the assets do pre-compilel despite jquery.flexslider.js being similarly located under vendor/assets/bower_components/flexslider. The only substantive difference I can see is that there is also an additional minified version of flexslider but not fitvids.

为什么预编译不能在fitvids的生产中起作用?

Why isnt the precompile working in production for fitvids?

推荐答案

原来,当我最初使用bower-rails安装fitvids时,我使用了FitVids的github存储库名称,因此bower-rails创建了该名称的目录. .后来,当我将名称更改为fitvids(全部为小写)时,github并未完全注册更改.这是gibhub的已知功能,与它需要在识别大写的文件系统和不识别大写的文件系统之间工作有关.结果,该目录的大写版本为空,正在部署到Heroku.

It turned out that when I originally installed fitvids using bower-rails, I used the github repository name of FitVids, so bower-rails created a directory of that name. Later, when I altered the name to fitvids (all lower case), then github did not fully register the change. This is a known feature of gibhub, related to it needing to work between file systems that recognise capitalisation and those that do not. As a result, the capitalised version of the directory, which was empty, was deploying to Heroku.

解决方案是从磁盘和git中完全删除fitvids文件夹,然后重新进行全新安装.感谢凉亭上的SergeyKishenin对此提供的协助.

The solution was to complete remove the fitvids folder from the disk and git, and then do a fresh re-install. Thanks to SergeyKishenin at bower-rails for assisting with this.

这篇关于fitvids正在开发中加载,但无法在heroku上进行预编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-25 03:05