gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 07:33:39 25 4
gpt4 key购买 nike

Modernizr 2 很容易从 rails-assets 安装.

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

但是,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. https://modernizr.com/docs/



这听起来好像我再也无法从 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

关于ruby-on-rails - 如何通过 rails-assets 安装 Modernizr 3?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32704406/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com