找不到'jquery-ui'Rails 3.2 [英] Can't find 'jquery-ui' Rails 3.2
问题描述
我一直到处寻找解决这个问题的方法.我已经在我的gemfile中将jquery-rails gem降级到2.3.0.但是当我在application.js中包含jquery-ui时,仍然出现Sprokets :: FileNotFound错误.
I have been looking everywhere to figure out this problem. I already downgraded the jquery-rails gem to 2.3.0 in my gemfile. But when I include jquery-ui in application.js I still get the Sprokets::FileNotFound error.
couldn't find file 'jquery-ui'
(in /home/richard/projects/pickaxe/mini-projects/depot-app/app/assets/javascripts/application.js:14)
这是我的application.js文件:
This is my application.js file:
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
// GO AFTER THE REQUIRES BELOW.
//
//= require jquery
//= require jquery-ui
//= require jquery_ujs
//= require_tree .
我很想找出为什么这不起作用...
I am dying to find out why this isn't working...
推荐答案
如果您使用的是 jquery-ui-rails gem ,则需要使用require jquery.ui.all
而不是require jquery-ui
.如果您不想使用gem,请确保app/assets/javascripts
文件夹中有一个jquery-ui.js
文件.
If you are using the jquery-ui-rails gem, you need to use require jquery.ui.all
instead of require jquery-ui
. If you don't want to use the gem, make sure that you have a jquery-ui.js
file in your app/assets/javascripts
folder.
更新
从5.0.0版开始,使用require jquery.ui
.
As of version 5.0.0, use require jquery.ui
.
这篇关于找不到'jquery-ui'Rails 3.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!