我在尝试安装 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 密码: 构建 native 扩展。这可能需要一段时间... 错误:安装 calabash-android 时出错: 错误:无法构建 gem native 扩展。
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
正在检查 -lc 中的 main()... 是的 创建生成文件
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 工具。有什么想法吗?
最佳答案
我遇到了同样的问题,我刚刚找到了解决方案。
我在这里发现了一个相关问题:
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
)
仅此而已。希望它也适用于您!
关于android - 在 OS X Mavericks 上安装 Calabash-Android 会导致错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22723980/