5

我今天下载并安装了 Sencha Touch 2.0,我观看了教程视频,一切都很顺利,直到我尝试构建应用程序。

起初我遇到了 Compass 的问题,教程没有提到必须安装 Compass,因此必须让 Ruby 在您的系统上运行,然后安装 compass GEM,但我没有问题地解决了这部分问题。

下次我运行它时,构建进展更进一步,但仍然给我一个错误,这一次我看不到任何关于缺少什么的指标。也许我需要安装额外的 SDK?

我正在运行带有 Ruby 1.8.7 和 Windows 7 操作系统的 Sencha Touch 2.1.0、Sencha Command 3.0.2.28,cmd 输出如下,如果有人有任何指示,将不胜感激。

[INF]           init-sencha-command:
[INF]
[INF]           init:
[INF]
[INF]           -before-app-build:
[INF]
[INF]           app-build-impl:
[INF]
[INF]           production:
[INF]
[INF]           -before-init-local:
[INF]
[INF]           -init-local:
[INF]
[INF]           -after-init-local:
[INF]
[INF]           init-local:
[INF]
[INF]           find-cmd:
[INF]
[INF]           -before-init:
[INF]
[INF]           -init:
[INF]
[INF]           -after-init:
[INF]
[INF]           init:
[INF]
[INF]           -before-build:
[INF]
[INF]           sass:
[INF]
[INF]           -before-sass:
[INF]
[INF]           -sass:
[INF]           [shellscript]
[INF]           [shellscript] C:\xampp\htdocs\MyApp\resources\sass>compass compi
le --boring --force
[INF]           [shellscript] C:/Ruby187/lib/ruby/1.8/optparse.rb:1450:in `compl
ete''': invalid option: --boring (OptionParser::InvalidOption)
[INF]           [shellscript]   from C:/Ruby187/lib/ruby/1.8/optparse.rb:1448:in
 `catch'''
[INF]           [shellscript]   from C:/Ruby187/lib/ruby/1.8/optparse.rb:1448:in
 `complete'''
[INF]           [shellscript]   from C:/Ruby187/lib/ruby/1.8/optparse.rb:1261:in
 `parse_in_order'''
[INF]           [shellscript]   from C:/Ruby187/lib/ruby/1.8/optparse.rb:1254:in
 `catch'''
[INF]           [shellscript]   from C:/Ruby187/lib/ruby/1.8/optparse.rb:1254:in
 `parse_in_order'''
[INF]           [shellscript]   from C:/Ruby187/lib/ruby/1.8/optparse.rb:1248:in
 `order!'''
[INF]           [shellscript]   from C:/Ruby187/lib/ruby/1.8/optparse.rb:1339:in
 `permute!'''
[INF]           [shellscript]   from C:/Ruby187/lib/ruby/1.8/optparse.rb:1360:in
 `parse!'''
[INF]           [shellscript]   from C:/Ruby187/lib/ruby/gems/1.8/gems/chrisepps
tein-compass-0.8.17/lib/compass/exec.rb:65:in `parse!'''
[INF]           [shellscript]   from C:/Ruby187/lib/ruby/gems/1.8/gems/chrisepps
tein-compass-0.8.17/lib/compass/exec.rb:35:in `initialize'''
[INF]           [shellscript]   from C:/Ruby187/lib/ruby/gems/1.8/gems/chrisepps
tein-compass-0.8.17/bin/compass:7:in `new'''
[INF]           [shellscript]   from C:/Ruby187/lib/ruby/gems/1.8/gems/chrisepps
tein-compass-0.8.17/bin/compass:7
[INF]           [shellscript]   from C:/Ruby187/bin/compass:23:in `load'''
[INF]           [shellscript]   from C:/Ruby187/bin/compass:23
[ERR]
[ERR]           BUILD FAILED
[ERR]           com.sencha.exceptions.BasicException: The following error occurr
ed while executing this line:
[ERR]           C:\xampp\htdocs\MyApp\.sencha\app\build-impl.xml:109: The follow
ing error occurred while executing this line:
[ERR]           jar:file:/C:/xampp/htdocs/sencha/Sencha/Cmd/3.0.2.288/sencha.jar
!/com/sencha/ant/antlib.xml:364: shellscript returned: 1
[ERR]                   at com.sencha.exceptions.BasicException.wrap(BasicExcept
ion.java:43)
[ERR]                   at com.sencha.cli.Command.dispatch(Command.java:104)
[ERR]                   at com.sencha.cli.Commands.dispatch(Commands.java:49)
[ERR]                   at com.sencha.cli.AbstractCommand.dispatch(AbstractComma
nd.java:182)
[ERR]                   at com.sencha.ant.SenchaCommandTask.doExecute(SenchaComm
andTask.java:69)
[ERR]                   at com.sencha.ant.BaseAntTask.execute(BaseAntTask.java:2
2)
[ERR]                   at org.apache.tools.ant.UnknownElement.execute(UnknownEl
ement.java:291)
[ERR]                   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native M
ethod)
[ERR]                   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown S
ource)
[ERR]                   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unkno
wn Source)
[ERR]                   at java.lang.reflect.Method.invoke(Unknown Source)
[ERR]                   at org.apache.tools.ant.dispatch.DispatchUtils.execute(D
ispatchUtils.java:106)
[ERR]                   at org.apache.tools.ant.Task.perform(Task.java:348)
[ERR]                   at org.apache.tools.ant.Target.execute(Target.java:392)
[ERR]                   at org.apache.tools.ant.Target.performTasks(Target.java:
413)
[ERR]                   at org.apache.tools.ant.Project.executeSortedTargets(Pro
ject.java:1399)
[ERR]                   at org.apache.tools.ant.Project.executeTarget(Project.ja
va:1368)
[ERR]                   at org.apache.tools.ant.helper.DefaultExecutor.executeTa
rgets(DefaultExecutor.java:41)
[ERR]                   at org.apache.tools.ant.Project.executeTargets(Project.j
ava:1251)
[ERR]                   at com.sencha.ant.AntRunner.run(AntRunner.java:156)
[ERR]                   at com.sencha.ant.AntRunner.run(AntRunner.java:72)
[ERR]                   at com.sencha.command.BasePluginCommands$BasePluginComma
nd.run(BasePluginCommands.java:94)
[ERR]                   at com.sencha.command.BasePluginCommands$BasePluginComma
nd.run(BasePluginCommands.java:98)
[ERR]                   at com.sencha.command.BasePluginCommands$BaseNamePathCom
mand.run(BasePluginCommands.java:142)
[ERR]                   at com.sencha.command.app.AppCommands$BuildCommand.execu
te(AppCommands.java:116)
[ERR]                   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native M
ethod)
[ERR]                   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown S
ource)
[ERR]                   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unkno
wn Source)
[ERR]                   at java.lang.reflect.Method.invoke(Unknown Source)
[ERR]                   at com.sencha.cli.Command.dispatch(Command.java:78)
[ERR]                   at com.sencha.cli.Commands.dispatch(Commands.java:49)
[ERR]                   at com.sencha.cli.Commands.dispatch(Commands.java:49)
[ERR]                   at com.sencha.command.Sencha.main(Sencha.java:71)
[ERR]           Caused by: C:\xampp\htdocs\MyApp\.sencha\app\build-impl.xml:117:
 The following error occurred while executing this line:
[ERR]           C:\xampp\htdocs\MyApp\.sencha\app\build-impl.xml:109: The follow
ing error occurred while executing this line:
[ERR]           jar:file:/C:/xampp/htdocs/sencha/Sencha/Cmd/3.0.2.288/sencha.jar
!/com/sencha/ant/antlib.xml:364: shellscript returned: 1
[ERR]                   at org.apache.tools.ant.ProjectHelper.addLocationToBuild
Exception(ProjectHelper.java:551)
[ERR]                   at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:44
4)
[ERR]                   at org.apache.tools.ant.taskdefs.CallTarget.execute(Call
Target.java:105)
[ERR]                   at org.apache.tools.ant.UnknownElement.execute(UnknownEl
ement.java:291)
[ERR]                   at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown
Source)
[ERR]                   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unkno
wn Source)
[ERR]                   at java.lang.reflect.Method.invoke(Unknown Source)
[ERR]                   at org.apache.tools.ant.dispatch.DispatchUtils.execute(D
ispatchUtils.java:106)
[ERR]                   at org.apache.tools.ant.Task.perform(Task.java:348)
[ERR]                   at org.apache.tools.ant.Target.execute(Target.java:392)
[ERR]                   at org.apache.tools.ant.Target.performTasks(Target.java:
413)
[ERR]                   at org.apache.tools.ant.Project.executeSortedTargets(Pro
ject.java:1399)
[ERR]                   at org.apache.tools.ant.Project.executeTarget(Project.ja
va:1368)
[ERR]                   at org.apache.tools.ant.helper.DefaultExecutor.executeTa
rgets(DefaultExecutor.java:41)
[ERR]                   at org.apache.tools.ant.Project.executeTargets(Project.j
ava:1251)
[ERR]                   at com.sencha.ant.AntRunner.run(AntRunner.java:156)
[ERR]                   at com.sencha.ant.AntRunner.run(AntRunner.java:80)
[ERR]                   at com.sencha.command.ant.AntCommand.execute(AntCommand.
java:75)
[ERR]                   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native M
ethod)
[ERR]                   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown S
ource)
[ERR]                   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unkno
wn Source)
[ERR]                   at java.lang.reflect.Method.invoke(Unknown Source)
[ERR]                   at com.sencha.cli.Command.dispatch(Command.java:78)
[ERR]                   ... 31 more
[ERR]           Caused by: C:\xampp\htdocs\MyApp\.sencha\app\build-impl.xml:109:
 The following error occurred while executing this line:
[ERR]           jar:file:/C:/xampp/htdocs/sencha/Sencha/Cmd/3.0.2.288/sencha.jar
!/com/sencha/ant/antlib.xml:364: shellscript returned: 1
[ERR]                   at org.apache.tools.ant.ProjectHelper.addLocationToBuild
Exception(ProjectHelper.java:551)
[ERR]                   at org.apache.tools.ant.taskdefs.MacroInstance.execute(M
acroInstance.java:401)
[ERR]                   at org.apache.tools.ant.UnknownElement.execute(UnknownEl
ement.java:291)
[ERR]                   at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown
Source)
[ERR]                   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unkno
wn Source)
[ERR]                   at java.lang.reflect.Method.invoke(Unknown Source)
[ERR]                   at org.apache.tools.ant.dispatch.DispatchUtils.execute(D
ispatchUtils.java:106)
[ERR]                   at org.apache.tools.ant.Task.perform(Task.java:348)
[ERR]                   at org.apache.tools.ant.Target.execute(Target.java:392)
[ERR]                   at org.apache.tools.ant.Target.performTasks(Target.java:
413)
[ERR]                   at org.apache.tools.ant.Project.executeSortedTargets(Pro
ject.java:1399)
[ERR]                   at org.apache.tools.ant.helper.SingleCheckExecutor.execu
teTargets(SingleCheckExecutor.java:38)
[ERR]                   at org.apache.tools.ant.Project.executeTargets(Project.j
ava:1251)
[ERR]                   at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:44
2)
[ERR]                   ... 52 more
[ERR]           Caused by: jar:file:/C:/xampp/htdocs/sencha/Sencha/Cmd/3.0.2.288
/sencha.jar!/com/sencha/ant/antlib.xml:364: shellscript returned: 1
[ERR]                   at org.apache.tools.ant.taskdefs.ExecTask.runExecute(Exe
cTask.java:646)
[ERR]                   at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTa
sk.java:672)
[ERR]                   at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTa
sk.java:498)
[ERR]                   at net.sf.antcontrib.platform.ShellScriptTask.execute(Sh
ellScriptTask.java:132)
[ERR]                   at org.apache.tools.ant.UnknownElement.execute(UnknownEl
ement.java:291)
[ERR]                   at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown
Source)
[ERR]                   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unkno
wn Source)
[ERR]                   at java.lang.reflect.Method.invoke(Unknown Source)
[ERR]                   at org.apache.tools.ant.dispatch.DispatchUtils.execute(D
ispatchUtils.java:106)
[ERR]                   at org.apache.tools.ant.Task.perform(Task.java:348)
[ERR]                   at org.apache.tools.ant.taskdefs.Sequential.execute(Sequ
ential.java:68)
[ERR]                   at net.sf.antcontrib.logic.IfTask.execute(IfTask.java:19
7)
[ERR]                   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native M
ethod)
[ERR]                   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown S
ource)
[ERR]                   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unkno
wn Source)
[ERR]                   at java.lang.reflect.Method.invoke(Unknown Source)
[ERR]                   at org.apache.tools.ant.dispatch.DispatchUtils.execute(D
ispatchUtils.java:106)
[ERR]                   at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.
java:154)
[ERR]                   at org.apache.tools.ant.UnknownElement.execute(UnknownEl
ement.java:291)
[ERR]                   at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown
Source)
[ERR]                   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unkno
wn Source)
[ERR]                   at java.lang.reflect.Method.invoke(Unknown Source)
[ERR]                   at org.apache.tools.ant.dispatch.DispatchUtils.execute(D
ispatchUtils.java:106)
[ERR]                   at org.apache.tools.ant.Task.perform(Task.java:348)
[ERR]                   at org.apache.tools.ant.taskdefs.Sequential.execute(Sequ
ential.java:68)
[ERR]                   at net.sf.antcontrib.logic.IfTask.execute(IfTask.java:19
7)
[ERR]                   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native M
ethod)
[ERR]                   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown S
ource)
[ERR]                   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unkno
wn Source)
[ERR]                   at java.lang.reflect.Method.invoke(Unknown Source)
[ERR]                   at org.apache.tools.ant.dispatch.DispatchUtils.execute(D
ispatchUtils.java:106)
[ERR]                   at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.
java:154)
[ERR]                   at org.apache.tools.ant.UnknownElement.execute(UnknownEl
ement.java:291)
[ERR]                   at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown
Source)
[ERR]                   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unkno
w
[ERR]           n Source)
[ERR]                   at java.lang.reflect.Method.invoke(Unknown Source)
[ERR]                   at org.apache.tools.ant.dispatch.DispatchUtils.execute(D
ispatchUtils.java:106)
[ERR]                   at org.apache.tools.ant.Task.perform(Task.java:348)
[ERR]                   at org.apache.tools.ant.taskdefs.Sequential.execute(Sequ
ential.java:68)
[ERR]                   at org.apache.tools.ant.UnknownElement.execute(UnknownEl
ement.java:291)
[ERR]                   at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown
Source)
[ERR]                   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unkno
wn Source)
[ERR]                   at java.lang.reflect.Method.invoke(Unknown Source)
[ERR]                   at org.apache.tools.ant.dispatch.DispatchUtils.execute(D
ispatchUtils.java:106)
[ERR]                   at org.apache.tools.ant.Task.perform(Task.java:348)
[ERR]                   at org.apache.tools.ant.taskdefs.MacroInstance.execute(M
acroInstance.java:398)
[ERR]                   ... 64 more
[ERR]
[ERR]           Total time: 12 seconds
[ERR]           com.sencha.exceptions.BasicException: The following error occurr
ed while executing this line:
C:\xampp\htdocs\MyApp\.sencha\app\build-impl.xml:109: The following error occurr
ed while executing this line:
jar:file:/C:/xampp/htdocs/sencha/Sencha/Cmd/3.0.2.288/sencha.jar!/com/sencha/ant
/antlib.xml:364: shellscript returned: 1

C:\xampp\htdocs\MyApp>
4

3 回答 3

1

指南针安装了吗?你可以在这里做到这一点:http: //compass-style.org/install/

于 2013-02-13T02:00:29.717 回答
0

您的指南针版本似乎很旧。尝试更新它,如user799301 所述。它可能还会要求您升级到 Ruby 1.9。

Sencha Cmd 正在为我使用 Compass 0.12.2 和 Ruby 1.9.3_p286,但任何足够新的版本都可以。

于 2013-02-13T02:33:49.507 回答
0

我觉得你的 ruby​​、指南针和/或 sass 版本太旧了。此行表示指南针存在问题:

...
[INF] [shellscript] C:\xampp\htdocs\MyApp\resources\sass>compass compile --boring --force
[INF] [shellscript] C:/Ruby187/lib/ruby/1.8/optparse.rb:1450:in `complete''': invalid option: --boring (OptionParser::InvalidOption)
...

昨天在 Windows 7 上运行“sass 构建步骤”时遇到了一些问题。

基本上我所做的是:

  • 从http://www.sencha.com/products/sencha-cmd/download安装 Sencha CMD 版本 3.0.2.288
  • 从http://rubyinstaller.org/安装 ruby​​ 1.9.3
  • 通过输入以下命令升级 gem 系统:gem update --system (version 1.8.25)
  • 安装指南针:gem install compass(版本为0.12.2)
  • 安装 Sass 3.1.10,compass 的依赖项。检查gem search sass,因为如果您安装了多个或更旧版本的 sass,它可能的指南针可能无法构建。

如果你只是想跳过 sass 构建,你也可以尝试输入:

skip.sass=1  

sencha.cfg

注意:我还有一个问题,即使在我安装了所有依赖项之后,新生成的 sencha touch 应用程序的构建也会失败,这是因为{app.dir}/resources/css/app.css中的 app.css 文件丢失了.

还有两个有趣的页面描述了我发现的构建过程:

于 2013-02-13T08:16:27.470 回答