在OS X Mavericks上安装Calabash-Android会导致错误

5

我需要帮助,尝试安装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 Password: 正在构建本地扩展,这可能需要一些时间... 错误:安装calabash-android时出错: 错误:无法构建宝石原生扩展。

/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: 警告:控制可能到达非void函数的结尾[-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

不确定错误的含义,我已经安装了适用于Mavericks的Xcode工具。有没有人有想法?


我降级到了 Ruby 的 1.8 版本,然后它就可以工作了。有趣。 - Doz
2个回答

3

我曾经也遇到过同样的问题,现在我找到了一个解决方法。

我在这里找到一个相关问题:

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

它建议我需要升级我的机器上的ruby版本。那个链接中的前两个命令无法工作,所以我在这里说明我做了什么:

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

xcode-select --install

在您的Mac上安装Homebrew:

使用以下命令:

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

就是这样。希望你也能成功!


2
你也可以尝试从https://stackoverflow.com/a/22787223/1165581获取解决方案。
我为你查看了calabash-ios的谷歌群组,我认为我有你的解决方案。
尝试按照以下方式安装。
sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install calabash-cucumber

如果失败了,您可以尝试将xcode从5.1降级到之前的版本(首选项->位置)。
参考链接:

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接