Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 安装https://github.com/twbs/bootstrap-rubygem 在rails 6 alpha上_Ruby On Rails_Twitter Bootstrap_Webpacker - Fatal编程技术网

Ruby on rails 安装https://github.com/twbs/bootstrap-rubygem 在rails 6 alpha上

Ruby on rails 安装https://github.com/twbs/bootstrap-rubygem 在rails 6 alpha上,ruby-on-rails,twitter-bootstrap,webpacker,Ruby On Rails,Twitter Bootstrap,Webpacker,如何在Rails6上安装引导gem() 引导自述文件要求我们向application.js添加内容 但是Rails6在通常的地方似乎没有application.js [Rails 6.0.0.alpha] bundle-exec-rails-new-noname--edge--database=postgresql--webpacker=react如果使用webpacker,您可能需要使用bootstrap的npm包 yarn add bootstrap@4.0.0 popper.js 及 和

如何在Rails6上安装引导gem()

引导自述文件要求我们向application.js添加内容 但是Rails6在通常的地方似乎没有application.js

[Rails 6.0.0.alpha]
bundle-exec-rails-new-noname--edge--database=postgresql--webpacker=react

如果使用webpacker,您可能需要使用bootstrap的npm包

yarn add bootstrap@4.0.0 popper.js

和内部stylesheets.scss

@import '~bootstrap/scss/bootstrap';

请查看此处的完整步骤:

这是我最基本的解决方案:

使用纱线安装
bootstrap
jquery
popper.js

$ yarn add bootstrap
$ yarn add jquery
$ yarn add popper.js
然后需要
app/javascript/packs/application.JS中的
bootstrap
JS和CSS

require('bootstrap')
require('bootstrap/dist/css/bootstrap.min.css')
注意:如果需要使用SCS自定义引导,则此解决方案不适合您。使用上面的@coorasse解决方案

require('bootstrap')
require('bootstrap/dist/css/bootstrap.min.css')