ruby-on-rails-3 - 安装 mysql2 gem 遇到错误

标签 ruby-on-rails-3 ruby-on-rails-3.1 rubygems ubuntu-11.04 mysql2

Rails 要求我成功安装 gem install mysql2 并在尝试时出现以下错误。那么此类错误的主要问题是什么?错误详情如下: 由于某种原因无法创建 Makefile,可能缺少 必要的库和/或 header 。检查 mkmf.log 文件了解更多信息 细节。您可能需要配置选项。

Provided configuration options:
--with-opt-dir
--without-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=/usr/local/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 /usr/local/lib/ruby/gems/1.9.1/gems/mysql2-0.3.7 for  inspection.
   Results logged to /usr/local/lib/ruby/gems/1.9.1/gems/mysql2-0.3.7/ext/mysql2/gem_make.out

结果出现此错误

       sudo gem install mysql2

mysql安装有问题吗?请告诉我们您所知道的一切,我非常感谢您花时间阅读我的问题。

谢谢

最佳答案

如果您尚未安装 mysql,请尝试添加以下完整包:

sudo apt-get install mysql-server mysql-server-5.1 libmysql-ruby libmysqlclient-dev mysql-client-5.1 mysql-common

另请查看此 heroku db:pull cant connect to my DB in ubuntu

关于ruby-on-rails-3 - 安装 mysql2 gem 遇到错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7967648/

相关文章:

ruby-on-rails - 使用 mongoid/mongodb/rails 访问引用字段

mysql - 用 1M 行填充数据库

ruby-on-rails - rubygem Twitter4R 问题

Ruby 以编程方式安装 gem

ruby-on-rails - 模型/ActiveRecord 不保存新数据

ruby-on-rails - Rails 如何使用 where 对多列进行排序?

javascript - 使用 Angular JS 通过 Rails Paperclip 提交文件

xml - Rails 3.1 和 RSS 自动检测

ruby-on-rails - 如何更新rails中多对多关系中的属性?

gem - 为什么使用 .freeze 和 .dup SomeGem::VERSION?