Sencha Cmd没有生成ExtJS应用程序

时间:2014-06-17 08:52:56

标签: javascript extjs build-process sencha-cmd

您好我正在尝试学习并开始使用ExtJS(from here)。但似乎要么我错过了什么,要么在这里遇到一些问题。每当我尝试执行第一个基本的简单命令时:sencha generate app -ext Myapp ./app它的失败都有以下例外:

Sencha Cmd v5.0.0.160
[ERR] java.lang.NullPointerException
 at javax.xml.bind.DatatypeConverter.printBase64Binary(DatatypeConverter.java:547)
 at com.sencha.util.StringUtil.toBase64(StringUtil.java:202)
 at com.sencha.tools.generator.DataStoreImpl.get(DataStoreImpl.java:103)
 at com.sencha.tools.generator.Generator$1.doMerge(Generator.java:464)
 at com.sencha.tools.generator.Generator$Mode$3.dispatch(Generator.java:269)
 at com.sencha.tools.generator.Generator.generateFileToFile(Generator.java:449)
 at com.sencha.tools.generator.Generator.generateFileToDir(Generator.java:441)
 at com.sencha.tools.generator.Generator.generateDirToDir(Generator.java:434)
 at com.sencha.tools.generator.Generator.generateDirToDir(Generator.java:429)
 at com.sencha.tools.generator.Generator.generate(Generator.java:148)
 at com.sencha.tools.pkg.LocalRepository.init(LocalRepository.java:130)
 at com.sencha.tools.pkg.LocalRepository.init(LocalRepository.java:184)
 at com.sencha.command.environment.WorkspaceRepository.getLocalRepository(WorkspaceRepository.java:274)
 at com.sencha.command.environment.FrameworkEnvironment.loadFrameworkPackage(FrameworkEnvironment.java:180)
 at com.sencha.command.generator.GeneratorCommands$WorkspaceCommand.getParameters(GeneratorCommands.java:146)
 at com.sencha.command.BasePluginCommands$BasePluginCommand.doExecute(BasePluginCommands.java:26)
 at com.sencha.command.generator.GeneratorCommands$WorkspaceCommand.execute(GeneratorCommands.java:116)
 at com.sencha.command.generator.GeneratorCommands$AppCommand.generateWorkspace(GeneratorCommands.java:468)
 at com.sencha.command.generator.GeneratorCommands$AppCommand.execute(GeneratorCommands.java:313)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at com.sencha.util.MethodInvoker$Arguments.invoke(MethodInvoker.java:175)
 at com.sencha.cli.Command.dispatch(Command.java:43)
 at com.sencha.cli.Commands.dispatch(Commands.java:64)
 at com.sencha.cli.Commands.dispatch(Commands.java:64)
 at com.sencha.command.Sencha.dispatch(Sencha.java:71)
 at com.sencha.command.Sencha.main(Sencha.java:139)

当我尝试执行sencha generate app MyApp ./app时会抛出异常:

Sencha Cmd v5.0.0.160 
[ERR] Unable to locate 'framework.dir' property from sencha.cfg and no framework directory specified
[ERR] Please ensure this command was executed from a valid framework directory
[ERR] No Framework specified  

这里的framework.dir是什么? 我已经下载了Sencha ExtJS v5.0.0 ,我需要将它保存在某个地方吗?

更新
运行sencha -sdk /path/to/extjs-5.0.0 generate app MyApp ./app给出相同结果后,说repo未正确初始化。

我已经安装了Ruby v1.9.3和Sencha Cmd v5.0.0.160,您可以在上面的异常之上看到它们。任何想法如何解决这个问题?

2 个答案:

答案 0 :(得分:1)

您必须从安装ext的目录运行Sencha Cmd,或者必须为其安装Ext的路径指定路径。

这应该有效:

sencha -sdk /path/to/ext/ generate app MyApp /where/you/want/the/app

答案 1 :(得分:1)

为了避免任何混淆,只需通过" sencha cmd"," sencha sdk"和您想要的应用程序目标目录。

喜欢

/Users/vishnu/bin/Sencha/Cmd/5.1.0.26/sencha -sdk /Users/vishnu/Documents/senchaworkspace/ext-5.0.1 generate app TutorialApp /Users/vishnu/Documents/senchaworkspace/TutorialApp

这对我很有用