我无法运行捆绑器,不断出现错误 [英] I can't run bundler, keep getting error

查看:116
本文介绍了我无法运行捆绑器,不断出现错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚将RoR开发环境迁移到了Ubuntu.我从github提取了一个我正在从事的项目,并试图安装所有必需的gem.但是,每当我运行bundlebundle installbundle install exec时,都会出现以下错误:

I have just migrated my RoR dev environmnent over to Ubuntu. I pulled a project that I'm working on from github, and am attempting to install all of the necessary gems. However, whenever I run bundle or bundle install or bundle install exec I get the following error:

    edu@edu:~/Workspace/SuitBrokers$ bundle install exec
Fetching source index for http://rubygems.org/
Installing rake (0.9.2.2) 
Installing multi_json (1.0.3) 
Installing activesupport (3.1.0) 
Installing bcrypt-ruby (3.0.1) with native extensions 
Installing builder (3.0.0) 
Installing i18n (0.6.0) 
Installing activemodel (3.1.0) 
Installing erubis (2.7.0) 
Installing rack (1.3.5) 
Installing rack-cache (1.0.3) 
Installing rack-mount (0.8.3) 
Installing rack-test (0.6.1) 
Installing hike (1.2.1) 
Installing tilt (1.3.3) 
Installing sprockets (2.0.3) 
Installing actionpack (3.1.0) 
Installing mime-types (1.17.2) 
Installing polyglot (0.3.3) 
Installing treetop (1.4.10) 
Installing mail (2.3.0) 
Installing actionmailer (3.1.0) 
Installing arel (2.2.1) 
Installing tzinfo (0.3.31) 
Installing activerecord (3.1.0) 
Installing activeresource (3.1.0) 
Installing ansi (1.4.1) 
Using bundler (1.0.21) 
Installing cocaine (0.2.0) 
Installing coffee-script-source (1.1.3) 
Installing execjs (1.2.9) 
Installing coffee-script (2.2.0) 
Installing rack-ssl (1.3.2) 
Installing json (1.6.1) with native extensions 
Installing rdoc (3.11) 
Installing thor (0.14.6) 
Installing railties (3.1.0) 
Installing coffee-rails (3.1.1) 
Installing jquery-rails (1.0.18) 
Installing mysql (2.8.1) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /home/edu/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb 
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... yes
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=/home/edu/.rvm/rubies/ruby-1.9.2-p290/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
    --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 /home/edu/Workspace/SuitBrokers/exec/ruby/1.9.1/gems/mysql-2.8.1 for inspection.
Results logged to /home/edu/Workspace/SuitBrokers/exec/ruby/1.9.1/gems/mysql-2.8.1/ext/mysql_api/gem_make.out
An error occured while installing mysql (2.8.1), and Bundler cannot continue.
Make sure that `gem install mysql -v '2.8.1'` succeeds before bundling.

有人处理过这种特别的痛苦吗?永远感谢您的帮助.

Has anyone dealt with this particular pain? Your help is eternally appreciated.

推荐答案

您需要告诉捆绑程序在哪里可以找到mysql-dev东西.通常,类似以下内容的东西会起作用:

You need to tell bundler where to find the mysql-dev stuff on your box. Usually something like the following will work:

bundle config build.mysql --with-mysql-config=/usr/local/mysql/bin/mysql_config

当然,您需要将上面的路径替换为mysql_config的实际路径.如果未安装mysql_config,则需要在服务器上安装mysql-dev软件包.看来您可能位于共享服务器上,因此希望已经安装了开发包.如果没有,则需要提出要求.

Of course, you'll need to replace the path above with your actual path to mysql_config. If you don't have mysql_config installed then you will need the mysql-dev package installed on your server. It looks like you're probably on a shared server, so hopefully the development package is already installed. If not, you'll need to request it.

这篇关于我无法运行捆绑器,不断出现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆