0

我已经在 Windows 7 上安装了 gitbash。

我安装了 Python,还添加了 C:/python33 的环境路径

克隆limejs后。当输入来自limejs 基础的第三步时。https://github.com/digitalfruit/limejs

我收到以下错误。

Welcome to Git (version 1.8.3-preview20130601)


Run 'git help git' to display the help index.
Run 'git help <command>' to display help for specific commands.

lenovo@BMI-AJINKYA /d/limejs (master)
$ python --version
Python 3.3.2

lenovo@BMI-AJINKYA /d/limejs (master)
$ python bin/lime.py --help
Usage: lime.py [command] [options]
Commands:
    init            Check lime dependecies and setup if needed
    update          Update Closure dependency file. Need to run every time you
                    change goog.provide() or goog.require()
    create [path/name]   Setup new project [name]
    gensoy [path]   Convert all *.soy files under path to *.soy.js files
    build [name]    Compile project to single Javascript file

Options:
  -h, --help            show this help message and exit
  -a, --advanced        Build uses ADVANCED_OPTIMIZATIONS mode (encouraged)
  -e EXTERNS_FILE, --externs=EXTERNS_FILE
                        File with externs declarations.
  -o OUTPUT, --output=OUTPUT
                        Output file for build result
  -m, --map             Build result sourcemap for debugging. Also turns on
                        pretty print.
  -s, --use-strict      Use EcmaScript5 strict mode.
  -p PRELOAD, --preload=PRELOAD
                        Generate preloader code with given callback as start
                        point.
  -d DEFINE, --define=DEFINE
                        Define custom variable accessible before build.

lenovo@BMI-AJINKYA /d/limejs (master)
$ bin/lime.py init
Closure Library not found. Downloading to D:\limejs\closure
Please wait...
Cloning into 'D:\limejs\closure'...
remote: Counting objects: 43590, done.
remote: Finding sources: 100% (43590/43590), done.
remote: Total 43590 (delta 35039)
Receiving objects: 100% (43590/43590), 17.23 MiB | 265.00 KiB/s, done.
Resolving deltas: 100% (35039/35039), done.
Checking out files: 100% (1884/1884), done.
Box2DJS not found. Downloading to D:\limejs\box2d
Please wait...
Cloning into 'D:\limejs\box2d'...
remote: Counting objects: 2250, done.
remote: Compressing objects: 100% (1172/1172), done.
emote: Total 2250 (delta 1092), reused 2222 (delta 1065)
Receiving objects: 100% (2250/2250), 1.01 MiB | 268.00 KiB/s, done.
Resolving deltas: 100% (1092/1092), done.
Downloading Closure Compiler:
100%
Unzipping...
Cleanup
Downloading Closure Templates(Soy):
100%
Unzipping...
Cleanup
Updating Closure deps file
python D:\limejs\closure\closure/bin/build/depswriter.py --root_with_prefix="D:\
limejs\closure/ ../../" --root_with_prefix="D:\limejs\lime/ ../../../lime/" --ro
ot_with_prefix="D:\limejs\box2d/src/ ../../../box2d/src/" --output_file="D:\lime
js\closure\closure/goog/deps.js"
Traceback (most recent call last):
  File "D:\limejs\closure\closure/bin/build/depswriter.py", line 202, in <module
>
    main()
  File "D:\limejs\closure\closure/bin/build/depswriter.py", line 178, in main
    path_to_source.update(_GetRelativePathToSourceDict(root, prefix=prefix))
  File "D:\limejs\closure\closure/bin/build/depswriter.py", line 145, in _GetRel
ativePathToSourceDict
    path_to_source[prefixed_path] = source.Source(source.GetFileContents(path))
  File "D:\limejs\closure\closure\bin\build\source.py", line 119, in GetFileCont
ents
    return fileobj.read()
  File "c:\Python33\lib\encodings\cp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position 7027: cha
racter maps to <undefined>

lenovo@BMI-AJINKYA /d/limejs (master)
$
4

1 回答 1

0

我修好了它。我卸载 Python 3.3 并安装了 Python 2.7。

问题是 Python 3.x 使用系统的默认编码将文本文件自动解码为 Unicode,这可能会导致错误。

安装 Python 2.7,我也没有编译错误,limejs helloworld 示例现在可以正常工作。

于 2013-08-21T07:11:21.670 回答