Mac OS X安装native gem提示找不到 dyld_stub_binding_helper

简介:

    在Mac OS X10.10下sudo gem install curses 返回如下错误:

apple@kissAir: ruby_src$sudo gem install curses

Password:

Fetching: curses-1.0.1.gem (100%)

Building native extensions.  This could take a while...

ERROR:  Error installing curses:

ERROR: Failed to build gem native extension.


    /Users/apple/.rvm/rubies/ruby-2.1.3/bin/ruby extconf.rb

checking for tgetent() in -ltinfo... no

checking for tgetent() in -ltermcap... yes

checking for ncurses.h... yes

checking for initscr() in -lncursesw... no

checking for initscr() in -lncurses... yes

header: ncurses.h

library: ncurses

checking for beep()... yes

checking for bkgd()... yes

checking for bkgdset()... yes

checking for curs_set()... yes

checking for deleteln()... yes

checking for doupdate()... yes

checking for flash()... yes

checking for getbkgd()... yes

checking for getnstr()... yes

checking for init()... no

checking for init in ncurses.h... no

checking for isendwin()... yes

checking for keyname()... yes

checking for keypad()... yes

checking for resizeterm()... yes

checking for scrl()... yes

checking for set()... no

checking for set in ncurses.h... no

checking for setscrreg()... yes

checking for ungetch()... yes

checking for wattroff()... yes

checking for wattron()... yes

checking for wattrset()... yes

checking for wbkgd()... yes

checking for wbkgdset()... yes

checking for wdeleteln()... yes

checking for wgetnstr()... yes

checking for wresize()... yes

checking for wscrl()... yes

checking for wsetscrreg()... yes

checking for def_prog_mode()... yes

checking for reset_prog_mode()... yes

checking for timeout()... yes

checking for wtimeout()... yes

checking for nodelay()... yes

checking for init_color()... yes

checking for wcolor_set()... yes

checking for use_default_colors()... yes

checking for newpad()... yes

checking for ESCDELAY in ncurses.h... yes

checking for TABSIZE in ncurses.h... yes

checking for COLORS in ncurses.h... yes

checking for COLOR_PAIRS in ncurses.h... yes

checking for function curses_version in ncurses.h... yes

checking for variable curses_version in ncurses.h... no

creating Makefile


make "DESTDIR=" clean


make "DESTDIR="

compiling curses.c

linking shared-object curses.bundle

ld: warning: directory not found for option '-L/Users/mpapis/.sm/pkg/active/lib'

ld: symbol dyld_stub_binding_helper not found, normally in crt1.o/dylib1.o/bundle1.o for architecture x86_64

collect2: error: ld returned 1 exit status

make: *** [curses.bundle] Error 1


make failed, exit code 2


主要错误点是找不到符号dyld_stub_binding_helper,网上搜了一下,解决方法是将Xcode中的deployment target从低版本改为高版本,但我这个没用Xcode编译啊!想了一下,看上面编译器用的应该是gcc(4.9),要不用clang试试看呐?!

apple@kissAir: ruby_src$type gcc

gcc is /opt/local/bin/gcc

apple@kissAir: ruby_src$ls -lh /opt/local/bin/gcc

lrwxr-xr-x  1 root  admin    39B 10 27 06:15 /opt/local/bin/gcc -> /usr/local/Cellar/gcc/4.9.1/bin/gcc-4.9

apple@kissAir: ruby_src$sudo mv /opt/local/bin/gcc old_gcc

Password:

apple@kissAir: ruby_src$type gcc

gcc is /usr/bin/gcc

apple@kissAir: ruby_src$gcc -v

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1

Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)

Target: x86_64-apple-darwin14.0.0

Thread model: posix

apple@kissAir: ruby_src$clang -v

Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)

Target: x86_64-apple-darwin14.0.0

Thread model: posix


现在gcc实际连接在clang上了,遂再次安装gem:

apple@kissAir: ruby_src$sudo gem install curses

Building native extensions.  This could take a while...

Successfully installed curses-1.0.1

Parsing documentation for curses-1.0.1

Installing ri documentation for curses-1.0.1

Done installing documentation for curses after 3 seconds

1 gem installed


哦鸟!看一下导出的符号:

nm /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin14/curses.bundle

                 U _COLORS

                 U _COLOR_PAIRS

                 U _COLS

                 U _ESCDELAY

0000000000000732 T _Init_curses

                 U _LINES

                 U _TABSIZE

                 U ___sprintf_chk

                 U ___stack_chk_fail

                 U ___stack_chk_guard

                 U _beep

                 U _can_change_color

                 U _cbreak

                 U _color_content

                 U _curs_set

                 U _curses_version

                 U _def_prog_mode

                 U _delwin

                 U _doupdate

                 U _echo

                 U _endwin

                 U _flash

                 U _getbegx

                 U _getbegy

                 U _getcurx

                 U _getcury

                 U _getmaxx

                 U _getmaxy

                 U _getmouse

                 U _has_colors

                 U _idlok

                 U _init_color

                 U _init_pair

                 U _initscr

                 U _isendwin

                 U _keyname

                 U _keypad

                 U _mouseinterval

                 U _mousemask

                 U _mvwin

                 U _newpad

                 U _newwin

                 U _nl

                 U _nocbreak

                 U _nodelay

                 U _noecho

                 U _nonl

                 U _noraw

                 U _pair_content

                 U _pnoutrefresh

                 U _prefresh

                 U _raw

                 U _rb_ary_new3

                 U _rb_block_given_p

                 U _rb_cData

                 U _rb_cFalseClass

                 U _rb_cFixnum

                 U _rb_cFloat

                 U _rb_cNilClass

                 U _rb_cObject

                 U _rb_cSymbol

                 U _rb_cTrueClass

                 U _rb_check_typeddata

                 U _rb_data_typed_object_alloc

                 U _rb_define_alloc_func

                 U _rb_define_class_under

                 U _rb_define_const

                 U _rb_define_method

                 U _rb_define_module

                 U _rb_define_module_function

                 U _rb_define_module_under

                 U _rb_eArgError

                 U _rb_eRuntimeError

                 U _rb_eSecurityError

                 U _rb_fix2int

                 U _rb_gc_register_address

                 U _rb_gc_unregister_address

                 U _rb_isprint

                 U _rb_locale_str_new

                 U _rb_locale_str_new_cstr

                 U _rb_num2int

                 U _rb_num2long

                 U _rb_num2uint

                 U _rb_obj_alloc

                 U _rb_obj_class

                 U _rb_raise

                 U _rb_safe_level

                 U _rb_scan_args

                 U _rb_secure

                 U _rb_set_end_proc

                 U _rb_str_export_locale

                 U _rb_str_new_cstr

                 U _rb_string_value

                 U _rb_string_value_cstr

                 U _rb_thread_call_without_gvl

                 U _rb_undef_method

                 U _rb_yield

                 U _reset_prog_mode

                 U _resizeterm

                 U _ruby_xfree

                 U _ruby_xmalloc

                 U _scrollok

                 U _start_color

                 U _stdscr

                 U _subwin

                 U _ungetch

                 U _ungetmouse

                 U _use_default_colors

                 U _waddch

                 U _waddnstr

                 U _wattr_off

                 U _wattr_on

                 U _wattrset

                 U _wbkgd

                 U _wbkgdset

                 U _wborder

                 U _wclear

                 U _wclrtoeol

                 U _wcolor_set

                 U _wdelch

                 U _wgetch

                 U _wgetnstr

                 U _winch

                 U _winsch

                 U _winsdelln

                 U _wmove

                 U _wnoutrefresh

                 U _wrefresh

                 U _wresize

                 U _wscrl

                 U _wsetscrreg

                 U _wtimeout

                 U dyld_stub_binder

最后把gcc连接给它还原本色吧:

apple@kissAir: ~$gcc -v

Using built-in specs.

COLLECT_GCC=gcc

COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/4.9.1/libexec/gcc/x86_64-apple-darwin14.0.0/4.9.1/lto-wrapper

Target: x86_64-apple-darwin14.0.0

Configured with: ../configure --build=x86_64-apple-darwin14.0.0 --prefix=/usr/local/Cellar/gcc/4.9.1 --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-4.9 --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-cloog=/usr/local/opt/cloog --with-isl=/usr/local/opt/isl --with-system-zlib --enable-version-specific-runtime-libs --enable-libstdcxx-time=yes --enable-stage1-checking --enable-checking=release --enable-lto --disable-werror --with-pkgversion='Homebrew gcc 4.9.1' --with-bugurl=https://github.com/Homebrew/homebrew/issues --enable-plugin --disable-nls --enable-multilib

Thread model: posix

gcc version 4.9.1 (Homebrew gcc 4.9.1) 

apple@kissAir: ~$



相关文章
|
3天前
|
NoSQL Redis Docker
Mac上轻松几步搞定Docker与Redis安装:从下载安装到容器运行实测全程指南
Mac上轻松几步搞定Docker与Redis安装:从下载安装到容器运行实测全程指南
13 0
|
4天前
mac10.9安装win7
mac10.9安装win7
|
4天前
|
Unix Shell Linux
史上最全:MAC OS X 命令行汇总
史上最全:MAC OS X 命令行汇总
11 0
|
4天前
|
安全 Java iOS开发
MAC OS X 硬盘安装详细分解教程
MAC OS X 硬盘安装详细分解教程
12 1
|
4天前
|
IDE 5G 开发工具
HP4230s笔记本安装mac os总结(原创)
HP4230s笔记本安装mac os总结(原创)
|
4天前
|
编解码 Oracle iOS开发
VirtualBox虚拟机安装Mac OS X Lion系统详解
VirtualBox虚拟机安装Mac OS X Lion系统详解
|
1月前
|
监控 Unix Linux
Linux操作系统调优相关工具(四)查看Network运行状态 和系统整体运行状态
Linux操作系统调优相关工具(四)查看Network运行状态 和系统整体运行状态
34 0
|
1月前
|
Linux 编译器 开发者
Linux设备树解析:桥接硬件与操作系统的关键架构
在探索Linux的庞大和复杂世界时🌌,我们经常会遇到许多关键概念和工具🛠️,它们使得Linux成为了一个强大和灵活的操作系统💪。其中,"设备树"(Device Tree)是一个不可或缺的部分🌲,尤其是在嵌入式系统🖥️和多平台硬件支持方面🔌。让我们深入了解Linux设备树是什么,它的起源,以及为什么Linux需要它🌳。
Linux设备树解析:桥接硬件与操作系统的关键架构
|
2月前
|
Linux 数据安全/隐私保护 虚拟化
Linux技术基础(1)——操作系统的安装
本文是龙蜥操作系统(Anolis OS) 8.4 的安装指南,用户可以从[龙蜥社区下载页面](https://openanolis.cn/download)获取ISO镜像。安装方法包括物理机的光驱和USB闪存方式,以及虚拟机中的VMware Workstation Pro设置。安装过程涉及选择语言、配置安装目标、选择软件集合和内核,设置Root密码及创建新用户。安装完成后,可通过文本模式或图形化界面验证系统版本,如Anolis OS 8.4,标志着安装成功。
|
1月前
|
Linux
Linux操作系统调优相关工具(三)查看IO运行状态相关工具 查看哪个磁盘或分区最繁忙?
Linux操作系统调优相关工具(三)查看IO运行状态相关工具 查看哪个磁盘或分区最繁忙?
28 0