Bootstrap 4 Alpha 了6个版本,beta 了2个版本,拖的时间太长了,一直在跟进,最近又尝试编译了一下,发现还是坑多,记录下,前人踩坑,后人乘凉。
中文网站基本不用看了,因为更新太快,版本都落后,直接看英文官网吧。
官网:https://getbootstrap.com/
下载:https://getbootstrap.com/docs/4.0/getting-started/download/ 建议用 git clone 的方式。
编译:https://getbootstrap.com/docs/4.0/getting-started/build-tools/ 需要安装 node, ruby,会用到 npm gem 包管理方式,吐槽下,一个项目管理搞这么多语言合适么?我认为 node 完全能胜任。然后你最好能翻墙,否则很有可能会卡死。
1. 强烈推荐使用以下 node npm 版本:
node -v # 版本 6.11
npm -v # 版本 5.2
npm install npm@5.2
(npm 5.3 会有各种坑)
2. npm install bootstrap@4.0.0-beta 没有 Gem 文件,需要直接从 git 下载:
git clone https://github.com/twbs/bootstrap.git
3. npm 慢如死牛,设置源:
npm config set registry https://registry.npm.taobao.org
4. ruby 设置源,首先要下载证书,放到 C:\Ruby23\cacert.pem
设置系统环境变量:
set SSL_CERT_FILE=C:\\Ruby23\\cacert.pem
5. 设置 ruby gem 源:
gem sources --remove https://rubygems.org/
gem sources -a https://ruby.taobao.org/
gem sources -l
备用:https://gems.ruby-china.org/
bundle config mirror.https://rubygems.org https://gems.ruby-china.org
6. 管理员启动 cmd
7. 重新编译部分模块:
npm rebuild node-sass
npm cache clear --force
npm install
bundle install
npm run dist