gem install ffi -v'1.1.5'osx 10.8 [英] gem install ffi -v '1.1.5' osx 10.8

查看:139
本文介绍了gem install ffi -v'1.1.5'osx 10.8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直试图通过
$ b pre> gem install ffi -v'1.1.5'$ b $在OSX 10.8上安装ffi b

结果

 错误:安装ffi时出错:
错误:无法构建gem本机扩展。

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
检查ffi.h ...否
检查ffi.h在/ usr / local / include中,/ usr / include / ffi ... no
检查rb_thread_blocking_region()... no
检查ruby_native_thread_p()... no
检查rb_thread_call_with_gvl()... no
创建extconf.h
创建Makefile文件
$ b $ make
mkdir -p/Library/Ruby/Gems/1.8/宝石/ FFI-1.1.5 / EXT / ffi_c/ libffi-I386; (if [!-f/Library/Ruby/Gems/1.8/gems/ffi-1.1.5/ext/ffi_c\"/libffi-i386/Makefile];然后回显配置libffi for i386; cd/ Library / Ruby / Gems / 1.8 / gems / ffi-1.1.5 / ext / ffi_c/ libffi-i386&& env CC =xcrun ccCFLAGS = - arch i386LDFLAGS = - arch i386/ Library /Ruby/Gems/1.8/gems/ffi-1.1.5/ext/ffi_c/libffi\"/configure --disable-static --with-pic = yes --disable-dependency-tracking --host = i386-apple-达尔文> / dev / null; fi); env MACOSX_DEPLOYMENT_TARGET = 10.4 make -C/Library/Ruby/Gems/1.8/gems/ffi-1.1.5/ext/ffi_c\"/libffi-i386
配置libffi for i386
configure:警告:if你想设置--build类型,不要使用--host。
如果检测到交叉编译器,则将使用交叉编译模式
configure:error:在`/Library/Ruby/Gems/1.8/gems/ffi-1.1.5/ext/ffi_c/libffi- i386':
configure:error:C编译器无法创建可执行文件
请参阅`config.log'以获取更多详细信息
make [1]:***没有指定目标并且找不到makefile。停止。
make:*** [/Library/Ruby/Gems/1.8/gems/ffi-1.1.5/ext/ffi_c\"/libffi- i386 / .libs / libffi_convenience.a]错误2


Gem文件将保留安装在/Library/Ruby/Gems/1.8/gems/ffi-1.1.5中进行检查。
结果记录到/Library/Ruby/Gems/1.8/gems/ffi-1.1.5/ext/ffi_c/gem_make.out

我试图关注

安装ffi(1.1.2)时发生错误,并且Bundler无法继续







没有任何运气。

解决方案

我的ffi安装失败,出现了一个类似的错误信息:

  mkdir -p/Library/Ruby/Gems/1.8/gems/ffi-1.9.0/ext/ffi_c\"/libffi-i386; (if [!-f/Library/Ruby/Gems/1.8/gems/ffi-1.9.0/ext/ffi_c\"/libffi-i386/Makefile];然后echo为lib38i配置libffi; cd/ Library / Ruby / Gems / 1.8 / gems / ffi-1.9.0 / ext / ffi_c/ libffi-i386&& env CC =xcrun ccCFLAGS = -  arch i386LDFLAGS = -  arch i386/ Library /Ruby/Gems/1.8/gems/ffi-1.9.0/ext/ffi_c/libffi\"/configure --disable-static --with-pic = yes --disable-dependency-tracking --host = i386-apple-达尔文> / dev / null; fi); env MACOSX_DEPLOYMENT_TARGET = 10.4 make -C/Library/Ruby/Gems/1.8/gems/ffi-1.9.0/ext/ffi_c\"/libffi-i386 
配置libffi for i386
configure:警告:if你想设置--build类型,不要使用--host。
如果检测到交叉编译器,将使用交叉编译模式
configure:error:在`/Library/Ruby/Gems/1.8/gems/ffi-1.9.0/ext/ffi_c/libffi- i386':
configure:error:C compiler can not create executables

我发现xcrun cc in该命令并尝试手动运行它给了我Apple的消息,即我没有同意XCode命令行工具的许可协议。在sudo xcrun cc安装成功后。

  $ xcrun cc 
同意Xcode / iOS许可证需要管理员权限,请通过sudo以root身份重新运行。
$ sudo xcrun cc
您尚未同意Xcode许可协议。您必须同意以下两种许可协议才能使用Xcode。
按'Enter'键查看'/Applications/Xcode.app/Contents/Resources/English.lproj/License.rtf'中的许可协议'
...

```


I been trying to install ffi on OSX 10.8 via

gem install ffi -v '1.1.5'

with the result

ERROR:  Error installing ffi:
ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for ffi.h... no
checking for ffi.h in /usr/local/include,/usr/include/ffi... no
checking for rb_thread_blocking_region()... no
checking for ruby_native_thread_p()... no
checking for rb_thread_call_with_gvl()... no
creating extconf.h
creating Makefile

make
mkdir -p "/Library/Ruby/Gems/1.8/gems/ffi-1.1.5/ext/ffi_c"/libffi-i386; (if [ ! -f       "/Library/Ruby/Gems/1.8/gems/ffi-1.1.5/ext/ffi_c"/libffi-i386/Makefile ]; then echo "Configuring libffi for i386"; cd "/Library/Ruby/Gems/1.8/gems/ffi-1.1.5/ext/ffi_c"/libffi-i386 && env CC=" xcrun cc" CFLAGS="-arch i386 " LDFLAGS="-arch i386" "/Library/Ruby/Gems/1.8/gems/ffi-1.1.5/ext/ffi_c/libffi"/configure --disable-static --with-pic=yes --disable-dependency-tracking --host=i386-apple-darwin > /dev/null; fi); env MACOSX_DEPLOYMENT_TARGET=10.4 make -C "/Library/Ruby/Gems/1.8/gems/ffi-1.1.5/ext/ffi_c"/libffi-i386
Configuring libffi for i386
configure: WARNING: if you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used
configure: error: in `/Library/Ruby/Gems/1.8/gems/ffi-1.1.5/ext/ffi_c/libffi-i386':
configure: error: C compiler cannot create executables
See `config.log' for more details
make[1]: *** No targets specified and no makefile found.  Stop.
make: *** ["/Library/Ruby/Gems/1.8/gems/ffi-1.1.5/ext/ffi_c"/libffi-   i386/.libs/libffi_convenience.a] Error 2


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/ffi-1.1.5 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/ffi-1.1.5/ext/ffi_c/gem_make.out

I have tried to follow

An error occured while installing ffi (1.1.2), and Bundler cannot continue

and

Not able to install some gems after mountain lion upgrade

without any luck.

解决方案

My ffi installation failed with a pretty similar error message:

mkdir -p "/Library/Ruby/Gems/1.8/gems/ffi-1.9.0/ext/ffi_c"/libffi-i386; (if [ ! -f "/Library/Ruby/Gems/1.8/gems/ffi-1.9.0/ext/ffi_c"/libffi-i386/Makefile ]; then echo "Configuring libffi for i386"; cd "/Library/Ruby/Gems/1.8/gems/ffi-1.9.0/ext/ffi_c"/libffi-i386 && env CC=" xcrun cc" CFLAGS="-arch i386 " LDFLAGS="-arch i386" "/Library/Ruby/Gems/1.8/gems/ffi-1.9.0/ext/ffi_c/libffi"/configure --disable-static --with-pic=yes --disable-dependency-tracking --host=i386-apple-darwin > /dev/null; fi); env MACOSX_DEPLOYMENT_TARGET=10.4 make -C "/Library/Ruby/Gems/1.8/gems/ffi-1.9.0/ext/ffi_c"/libffi-i386
Configuring libffi for i386
configure: WARNING: if you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used
configure: error: in `/Library/Ruby/Gems/1.8/gems/ffi-1.9.0/ext/ffi_c/libffi-i386':
configure: error: C compiler cannot create executables

I spotted xcrun cc in the command and trying to run it manually gave me Apple's message that I had not agreed to XCode command line tools' license agreement. After the sudo xcrun cc the installation succeeded.

$ xcrun cc
Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.
$ sudo xcrun cc
You have not agreed to the Xcode license agreements. You must agree to both license agreements below in order to use Xcode.
Hit the Enter key to view the license agreements at '/Applications/Xcode.app/Contents/Resources/English.lproj/License.rtf'
...

```

这篇关于gem install ffi -v'1.1.5'osx 10.8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆