Ruby无法安装

Ruby无法安装,ruby,installation,Ruby,Installation,有一个现有的项目,我有开发人员的工作,我必须做他们的版本前端。在我尝试他们的版本之前,我的机器上的ruby一直运行良好 mysql2似乎不想安装 以下是错误日志: bundle install Fetching gem metadata from https://rubygems.org/....... Fetching gem metadata from https://rubygems.org/.. Fetching https://github.com/amatsuda/kaminari.

有一个现有的项目,我有开发人员的工作,我必须做他们的版本前端。在我尝试他们的版本之前,我的机器上的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.
我尝试过的事情:

  • 几乎每个问题都是关于这个特定问题的 --手动安装mysql(sudo gem安装mysql--with mysql config=/usr/local/mysql/bin/mysql\u config)
  • 完全卸载ruby并重新安装
  • 卸载rvm并重新填充
  • 使用
还尝试使用brew进行安装,并获得以下结果:

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。

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

在Ubuntu中,运行:

sudo apt-get install libmysqlclient-dev

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

您使用的是什么操作系统?可能是@AndrewMarshall的重复版本没有。我们已经阅读了该版本,但都不起作用。我已经发布了我在上面尝试过的大多数解决方案。mysql--version产生了什么?mysql版本14.14发行版5.6.12,用于osx10.8(x86_64),使用EditLine包装器