@huacnlee 因为想做多图片上传,看到帖子说 carrierwave 原生支持,但是需要指定 github 主分支. 如下
gem 'carrierwave', github: 'carrierwaveuploader/carrierwave'
并且 model 里是mount_uploaders :images, LocalUploader
不是mount_uploader
如果,不用 github 的版本,会 找不到mount_uploaders
.
我试了一下,本地图片上传多图片可以成功.
但是如果使用了 gem 'carrierwave-aliyun'
会出现,
$ rails s
/home/lux/.rvm/gems/ruby-2.2.4/gems/carrierwave-aliyun-0.4.3/lib/carrierwave-aliyun.rb:2:in `require': cannot load such file -- carrierwave/processing/mime_types (LoadError)
from /home/lux/.rvm/gems/ruby-2.2.4/gems/carrierwave-aliyun-0.4.3/lib/carrierwave-aliyun.rb:2:in `<top (required)>'
from /home/lux/.rvm/gems/ruby-2.2.4/gems/bundler-1.11.2/lib/bundler/runtime.rb:77:in `require'
from /home/lux/.rvm/gems/ruby-2.2.4/gems/bundler-1.11.2/lib/bundler/runtime.rb:77:in `block (2 levels) in require'
from /home/lux/.rvm/gems/ruby-2.2.4/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `each'
from /home/lux/.rvm/gems/ruby-2.2.4/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `block in require'
from /home/lux/.rvm/gems/ruby-2.2.4/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `each'
from /home/lux/.rvm/gems/ruby-2.2.4/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `require'
from /home/lux/.rvm/gems/ruby-2.2.4/gems/bundler-1.11.2/lib/bundler.rb:99:in `require'
from /home/lux/dowedo/dowedo-bill/config/application.rb:7:in `<top (required)>'
from /home/lux/.rvm/gems/ruby-2.2.4/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:78:in `require'
from /home/lux/.rvm/gems/ruby-2.2.4/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:78:in `block in server'
from /home/lux/.rvm/gems/ruby-2.2.4/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /home/lux/.rvm/gems/ruby-2.2.4/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:75:in `server'
from /home/lux/.rvm/gems/ruby-2.2.4/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /home/lux/.rvm/gems/ruby-2.2.4/gems/railties-4.2.5/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'