安装Calabash-Android会导致OS X Mavericks出错

时间:2014-03-28 22:04:43

标签: android ruby cucumber osx-mavericks calabash

嗨伙计们/ ruby​​ists,

我在尝试安装Calabash-Android时需要一些帮助。在安装了rvm,home-brew之后,当我安装Calabash时,我得到一个奇怪的错误:

sudo gem install calabash-android
Building native extensions.  This could take a while...
ERROR:  Error installing calabash-android:
ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
checking for main() in -lc... yes
creating Makefile

make "DESTDIR="
compiling gherkin_lexer_ar.c
ragel/i18n/ar.c.rl:440:1: warning: control may reach end of non-void function [-    Wreturn-type]
}
^
ext/gherkin_lexer_ar/gherkin_lexer_ar.c:864:18: warning: unused variable     'lexer_en_main' [-Wunused-const-variable]
static const int lexer_en_main = 1;
             ^
2 warnings generated.
linking shared-object gherkin_lexer_ar.bundle
clang: error: unknown argument: '-multiply_definedsuppress' [-Wunused-command-line-    argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
make: *** [gherkin_lexer_ar.bundle] Error 1


Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/gherkin-2.12.2 for   inspection.
Results logged to /Library/Ruby/Gems/2.0.0/gems/gherkin-        2.12.2/ext/gherkin_lexer_ar/gem_make.out
doronkatz@Dorons-MacBook-Air ~ $ mkdir ~/android
doronkatz@Dorons-MacBook-Air ~ $ mkdir ~/android
mkdir: /Users/doronkatz/android: File exists

doronkatz @ Dorons-MacBook-Air~ $ sudo gem install calabash-android 密码: 构建原生扩展。这可能需要一段时间...... 错误:安装calabash-android时出错:     错误:无法构建gem原生扩展。

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb

在-lc中检查main()...是的 创建Makefile

make "DESTDIR="

编译gherkin_lexer_ar.c     ragel / i18n / ar.c.rl:440:1:警告:控制可能达到无效函数的结束[-Wreturn-type]     }     ^     ext / gherkin_lexer_ar / gherkin_lexer_ar.c:864:18:警告:未使用的变量'lexer_en_main'[-Wunused-const-variable]     static const int lexer_en_main = 1;                  ^     产生了2个警告。    链接共享对象gherkin_lexer_ar.bundle     clang:错误:未知参数:' - multiply_definedsuppress'[-Wunused-command-line-argument-hard-error-in-future]     clang:注意:将来这将是一个很难的错误(不能降级为警告)     make: * [gherkin_lexer_ar.bundle]错误1

 Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/gherkin-2.12.2 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/gems/gherkin-   2.12.2/ext/gherkin_lexer_ar/gem_make.out

不确定错误意味着什么,我也为小牛队安装了Xcode工具。有什么想法吗?

2 个答案:

答案 0 :(得分:3)

我遇到了同样的问题,我刚刚找到了解决方案。

我在这里发现了一个相关的问题:

http://techespanto.wordpress.com/2013/03/29/upgrade-ruby-version-on-mac-osx/

它建议我必须在我的机器上升级ruby版本。该链接中的前两个命令不起作用,所以我把你留在这里做的事情:

使用以下命令安装mac的命令行工具:

xcode-select --install

使用以下命令在Mac中安装自制软件:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

使用以下命令安装rvm:

\curl -L https://get.rvm.io | bash -s stable --rails --autolibs=enable

列出最新的ruby版本:

rvm list known

使用以下命令安装最新的ruby版本:

rvm install ruby-<version>

(对我来说是ruby-2.1-head

这就是全部。希望它也适合你!

答案 1 :(得分:2)

您也可以尝试https://stackoverflow.com/a/22787223/1165581

中的解决方案

我为你看了calabash-ios google小组,我想我有你的解决方案

尝试像这样安装

sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install calabash-cucumber

如果失败,您可以尝试将xcode从5.1降级到之前的(Preferences-&gt; Locations)。

参考链接