导轨:4.0.0 红宝石:1.9.3
我animate()
在我的 Rails 应用程序中使用 jQuery 的方法。
我无法让它工作。
我已经阅读了jquery-ui-rails上的文档并按照那里提到的步骤进行操作,即
- 安装了宝石
- 将其包含在 Gemfile 中 -
gem 'jquery-ui-rails'
- 捆绑安装
//= require jquery.ui.all
在我的application.js
文件中添加了
然而我得到一个Sprockets::FileNotFound
错误。
Showing /Users/anil20787/workspace/railsdir/depot/app/views/layouts/application.html.erb where line #9 raised:
couldn't find file 'jquery.ui.all'
(in /Users/anil20787/workspace/railsdir/depot/app/assets/javascripts/application.js:14)
宝石文件
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
gem 'jquery-ui-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
我确实也查找了这篇文章,遇到了与我类似的问题,但它指向的是我已经遵循的文档。不知道我在哪里犯了错误。
任何帮助表示赞赏。谢谢