ruby-on-rails – 如何通过rails-assets安装modernizr 3?

modernizr 2从
rails-assets开始易于安装.

# Gemfile
gem 'rails-assets-modernizr'
# application.js
//= require modernizr

但是,现代化的3个文档说:

A lot has changed since the last version of Modernizr. There no longer is a single, base modernizr.js file. Instead, just head over to the Download page as you could have previously, and select the features you want to use in your project.
07001

这听起来好像我不能再从rails-assets获得modernizr 3了.这是真的?

正如所料,如果我尝试从rails-assets安装modernizr 3,我得到:

An ActionView::Template::Error occurred ...

  couldn't find file 'modernizr' ...
  app/assets/javascripts/application.js:20

最佳答案 我没有让v3工作.我通过更改我的gemfile来版本化为2.8.3:

source 'https://rails-assets.org' do
  gem 'rails-assets-respond'
  gem 'rails-assets-modernizr', '2.8.3'
end
点赞