Rails jquery-fileupload gem - couldn't find file error

ⅰ亾dé卋堺 提交于 2019-12-06 00:24:39

I found a "solution" - restarting rails server did the trick.

Remove it from assets group, and it'll work fine.

I have fix this by :

add

gem 'therubyracer'
gem 'execjs'

to your Gemfile.

and run bundle install and rake assets:precompile --trace RAILS_ENV=production

rorra

That's really weird, I just tried with a Gemfile:

source 'https://rubygems.org'

gem 'rails', '3.2.12'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'sqlite3'


# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  gem "jquery-fileupload-rails"

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platforms => :ruby

  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

and on application.js

//= require jquery
//= require jquery_ujs
//= require_tree .
//= require jquery-fileupload/basic

and worked great, did you run bundle ? I know its a stupid question but it may be

I think you wanna add the following line to application.js

//= require jquery-fileupload 

I ran into something similar lately. What worked for me was to load the gem directly from git

gem 'jquery-fileupload-rails', git: 'git://github.com/ollnixon/jquery-fileupload-rails.git'

And then to load the the needed ui styles

*= require jquery.fileupload-ui

Works flawlessly now

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!