gpt4 book ai didi

mysql - Ruby Gem Mysql Mac 10.6.8

转载 作者:行者123 更新时间:2023-11-30 00:46:18 26 4
gpt4 key购买 nike

我想为我在 Github 上 fork 的开源应用程序创建一个 MySQL 数据库:https://lobste.rs 。它是 Rails 4 代码库,并使用 SQL 后端作为数据库。我已遵循所有步骤,但是:

当我$ rake db:schema:load

答案是

Could not find mysql2-0.3.14 in any of the sources
Run `bundle install` to install missing gems.

我运行捆绑安装但是

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

/User/.rvm/rubies/ruby-1.9.3-p429/bin/ruby extconf.rb
checking for mysql_query() in -lmysqlclient... *** 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=/User/.rvm/rubies/ruby-1.9.3-p429/bin/ruby
--with-mysql-config
--without-mysql-config
--with-mysql-dir
--without-mysql-dir
--with-mysql-include
--without-mysql-include=${mysql-dir}/include
--with-mysql-lib
--without-mysql-lib=${mysql-dir}/lib
--with-mysqlclientlib
--without-mysqlclientlib
/User/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /User/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:461:in `try_link0'
from /User/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:476:in `try_link'
from /User/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:619:in `try_func'
from /User/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:870:in `block in find_library'
from /User/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
from /User/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
from /User/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /User/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
from /User/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /User/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
from /User/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
from /User/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:866:in `find_library'
from extconf.rb:39:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /User/.rvm/gems/ruby-1.9.3-p429/gems/mysql-2.9.1 for inspection.
Results logged to /User/.rvm/gems/ruby-1.9.3-p429/extensions/x86_64-darwin-10/1.9.1/mysql-2.9.1/gem_make.out

我相信我拥有适用于我的 Mac 10.6.8 Lion 的 Xcode 版本。

有人知道我如何从终端安装 mysql 的 ruby​​ gem 吗?谢谢!

mkmf.log 是:

"gcc-4.2 -o conftest -I/User/.rvm/rubies/ruby-1.9.3-p429/include/ruby-1.9.1/x86_64-darwin10.8.0 -I/User/.rvm/rubies/ruby-1.9.3-p429/include/ruby-1.9.1/ruby/backward -I/User/.rvm/rubies/ruby-1.9.3-p429/include/ruby-1.9.1 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include  -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration  -fno-common -pipe conftest.c  -L. -L/Users/miguelcarvajal/.rvm/rubies/ruby-1.9.3-p429/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L. -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib      -lruby.1.9.1  -lpthread -ldl -lobjc "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return 0;
6: }
/* end */

最佳答案

要回答有关从终端安装 mysql gem 的问题,请尝试运行:

gem install mysql2

关于mysql - Ruby Gem Mysql Mac 10.6.8,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21336917/

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