Jekyll on Windows: Pygments not working

前端 未结 10 1347
失恋的感觉
失恋的感觉 2020-12-23 20:06

I updated to the latest JekyllBuild (1.0.3) before I always used the RC. After updating the parsing of codes (with Pygments) doesn\'t work anymore. I always get the followin

10条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-23 20:44

    Lately, I've found the best way to deploy jekyll or whatever else environment on windows is using http://scoop.sh/ or https://chocolatey.org/.


    This error is mainly for the reason that Windows Shell can not find this command 'which' but Cygwin and MinGW. I think the best solution is modifying the popen.rb

    to this below:

    # Detect a suitable Python binary to use. We can't just use `python2`
    # because apparently some old versions of Debian only have `python` or
    # something like that.
    def python_binary
        if RUBY_PLATFORM =~ /(mswin|mingw|cygwin|bccwin)/
            return 'python'
        end
        @python_binary ||= begin
            `which python2`
            $?.success? ? "python2" : "python"
        end
    end
    

    There are also some details according to This page .

提交回复
热议问题