您的位置:首页 > Web前端 > BootStrap

本地部署Bootstrap帮助文档

2016-07-04 15:47 501 查看
最近重温Bootstrap,想把它吃透!就从头开始学习,从github上下载源码,按照其中readme.md文件中的方法把源码中docs部署在本地。期间遇到了点问题,这里记录一下。

按照readme.md中的说法,他们使用的是jekyll这个东东来host的。为了使用这个玩意儿,本地要有ruby环境。关于这一点readme.md中说的很详细,并没有出现问题,原文如下:

1. If necessary, [install Jekyll](http://jekyllrb.com/docs/installation) and other Ruby dependencies with `bundle install`.

   **Note for Windows users:** Read [this unofficial guide](http://jekyll-windows.juthilo.com/) to get Jekyll up and running without problems.

2. From the root `/bootstrap` directory, run `bundle exec jekyll serve` in the command line.

4. Open `http://localhost:9001` in your browser

安装好jekyll后,按照上面的说法在bootstrap源码的根目录中执行bundle exec jekyll serve,系统报错说没有bundle这个命令,我没用过ruby,也不知道这个是啥。我试着这几jekyll serve,报出了如下的错误:

Dependency Error: Yikes! It looks like you don't have jekyll-sitemap or one of its dependencies installed. In order to use Jekyll as currently configured, you'll need to install this gem. The full error message from Ruby is: 'cannot load such file -- jekyll-sitemap'
If you run into trouble, you can find helpful resources at http://jekyllrb.com/help/!
晕了,真心搞不懂了,我拿知道什么是jekyll-sitemap。我去jekyll官网上逛了一圈,上面有教怎么使用jekyll创建一个新的blog的,我试着做了:

jekyll new myblog

cd myblog

jekyll serve

成功了!我对比了myblog目录跟bootstrap目录,发现bootstrap根本与myblog目录结构不同,不过发现docs目录中的目录却跟myblog的目录结构相同。因此我就把命令行切换到bootstrap/docs下,再次执行jekyll serve。这次错误变了:

Configuration file: none

            Source: D:/windows/git/bootstrap/docs

       Destination: D:/windows/git/bootstrap/docs/_site

 Incremental build: disabled. Enable with --incremental

      Generating...

jekyll 3.1.6 | Error:  No such file or directory @ rb_sysopen - ./grunt/configBridge.json

找不到grunt/configBridge.json文件,我发现bootstrap根目录下有grunt,所以我把grunt拷贝到docs下。再次执行jekyll serve,这次成功了!!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: