0

有一个现有项目,我有开发人员在做,我必须在他们的版本上做前端。在我尝试他们的版本之前,我的机器上的 ruby​​ 运行良好。

似乎mysql2不想安装。

这是错误日志:

bundle install
Fetching gem metadata from https://rubygems.org/.......
Fetching gem metadata from https://rubygems.org/..
Fetching https://github.com/amatsuda/kaminari.git
remote: Counting objects: 3409, done.
remote: Compressing objects: 100% (2040/2040), done.
remote: Total 3409 (delta 1665), reused 2858 (delta 1159)
Receiving objects: 100% (3409/3409), 632.95 KiB | 936 KiB/s, done.
Resolving deltas: 100% (1665/1665), done.
Fetching http://github.com/thoughtbot/paperclip.git
remote: Counting objects: 8432, done.
remote: Compressing objects: 100% (5676/5676), done.
remote: Total 8432 (delta 4363), reused 6581 (delta 2612)
Receiving objects: 100% (8432/8432), 2.68 MiB | 2.05 MiB/s, done.
Resolving deltas: 100% (4363/4363), done.
Enter your password to install the bundled RubyGems to your system: 
Using rake (10.1.0) 
Using i18n (0.6.4) 
Using multi_json (1.7.7) 
Installing activesupport (3.2.9) 
Installing builder (3.0.4) 
Installing activemodel (3.2.9) 
Using erubis (2.7.0) 
Installing journey (1.0.4) 
Installing rack (1.4.5) 
Installing rack-cache (1.2) 
Using rack-test (0.6.2) 
Using hike (1.2.3) 
Using tilt (1.4.1) 
Installing sprockets (2.2.2) 
Installing actionpack (3.2.9) 
Using mime-types (1.23) 
Using polyglot (0.3.3) 
Using treetop (1.4.14) 
Installing mail (2.4.4) 
Installing actionmailer (3.2.9) 
Installing arel (3.0.2) 
Using tzinfo (0.3.37) 
Installing activerecord (3.2.9) 
Installing activeresource (3.2.9) 
Installing xml-simple (1.1.2) 
Installing aws-s3 (0.6.3) 
Installing json (1.8.0) 
Installing nokogiri (1.5.10) 
Installing uuidtools (2.1.4) 
Installing aws-sdk (1.12.0) 
Installing bcrypt-ruby (3.1.1) 
Installing coderay (1.0.9) 
Installing better_errors (0.9.0) 
Installing debug_inspector (0.0.2) 
Installing binding_of_caller (0.7.2) 
Installing climate_control (0.0.3) 
Installing cocaine (0.5.1) 
Installing coffee-script-source (1.6.3) 
Installing execjs (1.4.0) 
Installing coffee-script (2.2.0) 
Installing rack-ssl (1.3.3) 
Installing rdoc (3.12.2) 
Using thor (0.18.1) 
Installing railties (3.2.9) 
Installing coffee-rails (3.2.2) 
Installing daemons (1.1.9) 
Installing orm_adapter (0.4.0) 
Installing warden (1.2.3) 
Installing devise (3.0.0) 
Installing eventmachine (1.0.3) 
Installing haml (4.0.3) 
Using kaminari (0.14.1) from https://github.com/amatsuda/kaminari.git (at master) 
Installing libv8 (3.11.8.17) 
Installing mysql2 (0.3.12) 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /Users/lukaszwieczorek/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb 
checking for rb_thread_blocking_region()... yes
checking for rb_wait_for_single_fd()... yes
checking for rb_hash_dup()... yes
checking for rb_intern3()... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lmygcc... no
checking for mysql_query() in -lmysqlclient... no
*** 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/lukaszwieczorek/.rvm/rubies/ruby-2.0.0-p247/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}/
    --with-mysqlclientlib
    --without-mysqlclientlib
    --with-mlib
    --without-mlib
    --with-mysqlclientlib
    --without-mysqlclientlib
    --with-zlib
    --without-zlib
    --with-mysqlclientlib
    --without-mysqlclientlib
    --with-socketlib
    --without-socketlib
    --with-mysqlclientlib
    --without-mysqlclientlib
    --with-nsllib
    --without-nsllib
    --with-mysqlclientlib
    --without-mysqlclientlib
    --with-mygcclib
    --without-mygcclib
    --with-mysqlclientlib
    --without-mysqlclientlib


Gem files will remain installed in /Users/lukaszwieczorek/.bundler/tmp/2999/gems/mysql2-0.3.12 for inspection.
Results logged to /Users/lukaszwieczorek/.bundler/tmp/2999/gems/mysql2-0.3.12/ext/mysql2/gem_make.out

An error occurred while installing mysql2 (0.3.12), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.3.12'` succeeds before bundling.

我尝试过的事情:

还尝试使用 brew 安装并得到了这个:

冲泡安装mysql

Warning: It appears you have MacPorts or Fink installed.
Software installed with other package managers causes known problems for
Homebrew. If a formula fails to build, uninstall MacPorts/Fink and try again.
Warning: Building source; cellar of mysql's bottle is /usr/local/Cellar
==> Downloading http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.10.tar.gz/from/http://cdn.mysql.com/

curl: (22) The requested URL returned error: 404
Error: Download failed: http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.10.tar.gz/from/http://cdn.mysql.com/

有点不知所措。我运行 OSX。

4

1 回答 1

0

看起来您正在安装 mysql2 gem,它显然依赖于名为mysqlclient. gem 安装失败,因为它找不到mysqlclient. 这是我们一直发生的标准事情,解决方案是安装该库。

在 Ubuntu 中,运行:

sudo apt-get install libmysqlclient-dev

对于其他发行版,安装 mysqlclient 的命令会有所不同。

于 2013-07-19T01:16:16.387 回答