0

我的执行环境:

  1. windows 7 x64,繁体中文版
  2. rubyinstaller-1.9.3-p484
  3. DevKit-tdm-32-4.5.2-20110712-1620-sfx
  4. 葫芦-android 0.5.2

我使用的命令:

calabash-android run xxx.apk

我得到的错误信息:

No test server found for this combination of app and calabash version. Recreating test server.  
C:/Ruby193/lib/ruby/gems/1.9.1/gems/calabash-android-0.5.2/lib/calabash-android/helpers.rb:159:in `scan': invalid byte sequence in CP950 (ArgumentError)
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/calabash-android-0.5.2/lib/calabash-android/helpers.rb:159:in `extract_md5_fingerprint'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/calabash-android-0.5.2/lib/calabash-android/helpers.rb:151:in `block (2 levels) in fingerprint_from_apk'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/calabash-android-0.5.2/lib/calabash-android/helpers.rb:137:in `chdir'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/calabash-android-0.5.2/lib/calabash-android/helpers.rb:137:in `block in fingerprint_from_apk'
from C:/Ruby193/lib/ruby/1.9.1/tmpdir.rb:83:in `mktmpdir'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/calabash-android-0.5.2/lib/calabash-android/helpers.rb:136:in `fingerprint_from_apk'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/calabash-android-0.5.2/bin/calabash-android-build.rb:2:in `calabash_build'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/calabash-android-0.5.2/lib/calabash-android/helpers.rb:92:in `build_test_server_if_needed'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/calabash-android-0.5.2/bin/calabash-android-run.rb:16:in `calabash_run'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/calabash-android-0.5.2/bin/calabash-android:85:in `<top (required)>'
from C:/Ruby193/bin/calabash-android:24:in `load'
from C:/Ruby193/bin/calabash-android:24:in `<main>'
4

1 回答 1

0

这是因为在 windows 中文版上运行 Ruby 时,默认编码是 UTF-8。我们必须强制 Ruby 使用 UTF-8 编码运行它。所以我修改命令如下:

[Ruby installed path] -EUTF-8 [calabash-andorid installed path] run [apk path]

ps我的calabash-android安装路径:

C:\Ruby193\lib\ruby\gems\1.9.1\gems\calabash-android-0.5.2\bin\calabash-android
于 2014-09-12T12:03:19.800 回答