【问题标题】:How to use bootstrap-sass rake convert to create SASS version of Bootstrap v3.0.0如何使用bootstrap-sass rake convert创建SASS版Bootstrap v3.0.0
【发布时间】:2014-10-06 22:09:32
【问题描述】:

我有一个项目,我使用带有角度生成器的 yeoman 搭建了脚手架。我正在使用https://github.com/twbs/bootstrap-sass 提供的引导 SASS 功能。我有一个我想使用的引导主题,它是针对引导 v3.0.0 构建的。 bootstrap-sass 的最新版本是 v3.2.0,并且 repo 中没有对应于 bootstrap v.3.0.0 的版本。因此,我尝试按照 Upstream Converterhttps://github.com/twbs/bootstrap-sass 的说明将 bootstrap 3.0.0 less 转换为 SASS。当我运行“rake convert”时,一切似乎都正常。但是,当我运行示例中列出的“rake convert[e8a1df5f060bf7e6631554648e0abde150aedbe4]”时,rake 出现以下错误:

Convert Bootstrap LESS to SASS
 repo   : https://github.com/twbs/bootstrap
 branch : e8a1df5f060bf7e6631554648e0abde150aedbe4 https://github.com/twbs/bootstrap/tree/e8a1df5f060bf7e6631554648e0abde150aedbe4
 save to: {"js":"assets/javascripts/bootstrap","scss":"assets/stylesheets/bootstrap","fonts":"assets/fonts/bootstrap"}
 twbs cache: tmp/converter-cache-bootstrap
------------------------------------------------------------
Processing fonts...
  CACHED GET https://api.github.com/repos/twbs/bootstrap/git/trees/e8a1df5f060bf7e6631554648e0abde150aedbe4...
  CACHED GET https://api.github.com/repos/twbs/bootstrap/git/trees/7285f3ab6cb0aa40e75282615ae459af6ba00101...
  CACHED GET 4 files from https://raw.githubusercontent.com/twbs/bootstrap/e8a1df5f060bf7e6631554648e0abde150aedbe4/fonts glyphicons-halflings-regular.eot glyphicons-halflings-regular.svg glyphicons-halflings-regular.ttf glyphicons-halflings-regular.woff...
Processing stylesheets...
  CACHED GET https://api.github.com/repos/twbs/bootstrap/git/trees/c4320c56cf62c962f7d150c7b5777379e20f83d2...
  CACHED GET https://api.github.com/repos/twbs/bootstrap/git/trees/c4320c56cf62c962f7d150c7b5777379e20f83d2...
rake aborted!
undefined method `[]' for nil:NilClass
/home/apal/dev/bootstrap-sass/tasks/converter/network.rb:71:in `get_tree_sha'
/home/apal/dev/bootstrap-sass/tasks/converter/less_conversion.rb:142:in `bootstrap_less_files'
/home/apal/dev/bootstrap-sass/tasks/converter/less_conversion.rb:54:in `process_stylesheet_assets'
/home/apal/dev/bootstrap-sass/tasks/converter.rb:63:in `process_bootstrap'
/home/apal/dev/bootstrap-sass/Rakefile:16:in `block in <top (required)>'
/home/apal/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
/home/apal/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => convert
(See full trace by running task with --trace)

我对 ruby​​ 不太熟悉,所以不知道从哪里开始。好奇是否有人能让这个工作。我的红宝石环境可能有问题。我当前的 ruby​​ 版本是:

$ ruby​​ -v

ruby 2.1.1p76(2014-02-24 修订版 45161)[x86_64-linux]

$ rake -V

rake,版本 10.1.0

【问题讨论】:

    标签: twitter-bootstrap sass rake yeoman


    【解决方案1】:

    我发现问题是由旧版本(

    def bootstrap_less_files
      @bootstrap_less_files ||= get_paths_by_type('less', /\.less$/) 
      #+
      #  get_paths_by_type('mixins', /\.less$/,
      #                    get_tree(get_tree_sha('mixins', get_tree(get_tree_sha('less'))))).map { |p| "mixins/#{p}" }
    end
    

    另请参阅:https://github.com/twbs/bootstrap-sass/issues/735

    【讨论】:

      猜你喜欢
      • 2017-05-01
      • 2016-09-16
      • 1970-01-01
      • 2013-05-29
      • 2012-06-21
      • 1970-01-01
      • 1970-01-01
      • 2021-03-14
      • 2017-01-29
      相关资源
      最近更新 更多