mysql报错2_macbook 安装mysql2报错

sudo gem install mysql2

dyld: DYLD_ environment variables being ignored because main

executable (/usr/bin/sudo) is setuid or setgid

Password:

Building native extensions.  This could take

a while...

ERROR:  Error installing mysql2:

ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby

extconf.rb

checking for rb_thread_blocking_region()... yes

checking for rb_wait_for_single_fd()... yes

checking for mysql.h... yes

checking for errmsg.h... yes

checking for mysqld_error.h... yes

creating Makefile

make

xcrun cc -I. -I.

-I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin12.0

-I. -DHAVE_RB_THREAD_BLOCKING_REGION -DHAVE_RB_WAIT_FOR_SINGLE_FD

-DHAVE_MYSQL_H -DHAVE_ERRMSG_H -DHAVE_MYSQLD_ERROR_H

-D_XOPEN_SOURCE -D_DARWIN_C_SOURCE

-I/usr/local/mysql/include  -Os

-g -fno-common -fno-strict-aliasing -arch x86_64 -fno-common -arch

i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE

-fno-common  -pipe -fno-common

-Wall -funroll-loops  -c

client.c

xcrun: Error: could not stat active Xcode path

'/Volumes/Xcode/Xcode.app/Contents/Developer'. (No such file or

directory)

xcrun cc -I. -I.

-I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin12.0

-I. -DHAVE_RB_THREAD_BLOCKING_REGION -DHAVE_RB_WAIT_FOR_SINGLE_FD

-DHAVE_MYSQL_H -DHAVE_ERRMSG_H -DHAVE_MYSQLD_ERROR_H

-D_XOPEN_SOURCE -D_DARWIN_C_SOURCE

-I/usr/local/mysql/include  -Os

-g -fno-common -fno-strict-aliasing -arch x86_64 -fno-common -arch

i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE

-fno-common  -pipe -fno-common

-Wall -funroll-loops  -c

mysql2_ext.c

xcrun: Error: could not stat active Xcode path

'/Volumes/Xcode/Xcode.app/Contents/Developer'. (No such file or

directory)

xcrun cc -I. -I.

-I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin12.0

-I. -DHAVE_RB_THREAD_BLOCKING_REGION -DHAVE_RB_WAIT_FOR_SINGLE_FD

-DHAVE_MYSQL_H -DHAVE_ERRMSG_H -DHAVE_MYSQLD_ERROR_H

-D_XOPEN_SOURCE -D_DARWIN_C_SOURCE

-I/usr/local/mysql/include  -Os

-g -fno-common -fno-strict-aliasing -arch x86_64 -fno-common -arch

i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE

-fno-common  -pipe -fno-common

-Wall -funroll-loops  -c

result.c

xcrun: Error: could not stat active Xcode path

'/Volumes/Xcode/Xcode.app/Contents/Developer'. (No such file or

directory)

cc -arch i386 -arch x86_64 -pipe -bundle -undefined

dynamic_lookup -o mysql2.bundle client.o mysql2_ext.o result.o -L.

-L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib

-L. -arch i386 -arch x86_64

-Wl,-rpath,/usr/local/mysql/lib

-lruby -L/usr/local/mysql/lib

-lmysqlclient_r  -lpthread

-lpthread -ldl -lobjc

clang: error: no such file or directory: 'client.o'

clang: error: no such file or directory: 'mysql2_ext.o'

clang: error: no such file or directory: 'result.o'

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

解决办法: sudo xcode-select -switch

/Applications/Xcode.app

sudo gem install mysql2 --platform=ruby --

--with-mysql-dir=/usr/local/mysql

--with-mysql-lib=/usr/local/mysql/lib

–with-mysql-include=/usr/local/mysql/include

--with-mysql-config=/usr/local/mysql/bin/mysql_config

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值