2014-01-28 29 views
1

我是phonegap的新手,我试图将它安装在我的mac机器上,但出现错误。我正在关注this link作为参考。通过iOS api命令创建phonegap应用程序时出现错误

这是我的代码,我在我的Mac机上运行。

./create ~/desktop/hello com.test.hello hello and i am getting error as: 

./create: line 66: dirname: command not found 
/Users/administrator/Desktop/phonegap-2.9.0/lib/ios/bin/replaces: line 28: sed: command not found 
/Users/administrator/Desktop/phonegap-2.9.0/lib/ios/bin/replaces: line 28: sed: command not found 
/Users/administrator/Desktop/phonegap-2.9.0/lib/ios/bin/replaces: line 28: sed: command not found 
/Users/administrator/Desktop/phonegap-2.9.0/lib/ios/bin/replaces: line 28: sed: command not found 
/Users/administrator/Desktop/phonegap-2.9.0/lib/ios/bin/replaces: line 28: sed: command not found 
/Users/administrator/Desktop/phonegap-2.9.0/lib/ios/bin/replaces: line 28: sed: command not found 
/Users/administrator/Desktop/phonegap-2.9.0/lib/ios/bin/replaces: line 28: sed: command not found 
/Users/administrator/Desktop/phonegap-2.9.0/lib/ios/bin/replaces: line 28: sed: command not found 
/Users/administrator/Desktop/phonegap-2.9.0/lib/ios/bin/replaces: line 28: sed: command not found 
./create: /Users/administrator/Desktop/phonegap-2.9.0/lib/ios/bin/update_cordova_subproject: /usr/bin/python: bad interpreter: No such file or directory 

虽然hello.xcodeproj在给定的路径创建,但是当我尝试在Xcode收到此错误打开它:

Project /Users/administrator/Desktop/hello/hello.xcodeproj cannot be opened because the project file cannot be parsed. 

任何帮助将不胜感激。

+0

不要问我们遵循的指导。相反,发布给你的问题的确切命令。 – fedorqui

+0

./create〜/ desktop/hello com.test.hello hello命令给出错误。 – Chomu

+0

phonegap是安装在你的mac吗? – Sport

回答

2

看来phonegap没有正确安装。 最简单的方法是首先从nodejs.org下载node-js,然后使用其包管理器安装phonegap。

sudo npm install -g phonegap 

PhoneGap的安装后,你可以使用

phonegap local create com.test.hello hello 

要初始化项目

+0

当我运行上面的命令时出现错误:-bash:sudo:command not found。我的xcode现在也不能工作。 – Chomu

+1

你的$ PATH是怎么样的。在终端中键入'echo $ PATH'。也许你的路径变量是错误的。 'sudo'通常位于'/ usr/bin /'中。这是否失踪? – matthisb

+0

我的路径是这样的:/ usr/bin:/ bin:/ usr/sbin:/ sbin:/ usr/local/bin – Chomu

相关问题