gpt4 book ai didi

mysql - 使用 Rails 3 (Lion 10.7) 安装 MySQL Gem

转载 作者:行者123 更新时间:2023-11-30 23:34:12 25 4
gpt4 key购买 nike

当我尝试在 OSX 10.7 Lion 上使用 Rails 3 安装 MySQL gem 时出现此错误。我的 Ruby 版本是 ruby​​ 1.9.2p290。我已经安装了 MySQL 并且它运行良好。

Building native extensions.  This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.

/Users/garethbarker/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb --with-mysql-dir=/usr/bin --with-mysql-lib=/usr/lib64/mysql

checking for mysql_ssl_set()... no
checking for rb_str_set_len()... yes
checking for rb_thread_start_timer()... no
checking for mysql.h... yes
llvm-gcc-4.2: -E, -S, -save-temps and -M options are not allowed with multiple -arch flags
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

Provided configuration options:
--with-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/garethbarker/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
--with-mysql-config
--without-mysql-config


Gem files will remain installed in /Users/garethbarker/.rvm/gems/ruby-1.9.2-p290/gems/mysql-2.8.1 for inspection.
Results logged to /Users/garethbarker/.rvm/gems/ruby-1.9.2-p290/gems/mysql-2.8.1/ext/mysql_api/gem_make.out

最佳答案

我记得在我的 Lion OS 上遇到过类似的问题。试试这个。我发现它在我的 ~/.bash_profile 中。添加到你的 ~/.bash_profile:

export DYLD_LIBRARY_PATH=/usr/local/mysql/lib:$DYLD_LIBRARY_PATH

export DYLD_LIBRARY_PATH=/usr/local/mysql/lib

关于mysql - 使用 Rails 3 (Lion 10.7) 安装 MySQL Gem,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8963624/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com