我正在尝试使用jquery文件上传来上传多张图片。在我的application.js
文件中,我添加了//= require jquery-fileupload/basic
,在我的Gemfile
中,我在资产组下添加了jquery-fileupload-rails
。这会导致错误:找不到文件jquery-fileupload/basic
。我已重置我的rails服务器并检查application.js
中的空格但是错误仍然存在。任何帮助将不胜感激
的application.js
//= require jquery
//= require jquery_ujs
//= require jquery-fileupload/basic
//= require jquery.ui.datepicker
//= require jquery.ui.tooltip
//= require jquery-ui-1.10.4.custom.min
//= require jquery.timepicker.min
//= require bootstrap/dropdown
//= require bootstrap/modal
//= require raty
//= require_tree .
的Gemfile
gem 'byebug', '~> 3.5.1'
gem 'rails', '4.0.3'
gem 'pg'
gem 'bootstrap-sass', '~> 3.1.1'
gem 'devise'
gem 'faker'
gem 'geocoder'
gem 'carrierwave'
gem 'mini_magick'
gem 'figaro'
gem 'state_machine'
gem 'jquery-ui-rails', '~> 4.2.1'
gem 'rails_12factor'
gem 'elasticsearch-model'
gem 'simple_form'
gem 'omniauth-facebook'
gem 'omniauth-linkedin'
gem 'omniauth'
gem 'pry-rails'
group :development, :test do
gem 'rspec-rails', '2.13.1'
gem 'quiet_assets'
# gem 'pry-debugger'
gem 'meta_request'
gem 'interactive_editor'
gem 'hirb'
gem 'quiet_assets'
gem 'awesome_print'
end
#
group :test do
gem 'selenium-webdriver', '2.35.1'
gem 'capybara', '2.1.0'
gem 'factory_girl_rails', '4.2.1'
end
gem 'sass-rails', '~> 4.0.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
group :assets do
gem 'jquery-ui-rails', '~> 4.2.1'
gem 'jquery-fileupload-rails'
end
答案 0 :(得分:3)
将其放在资产组之外并运行bundle install
。
btw jquery-ui-rails
不属于那里