我在尝试为 Rails 安装 mysql2 gem 时遇到一些问题.当我尝试通过运行 bundle install 或 gem install mysql2 来安装它时,它给了我以下错误:
I am having some problems when trying to install mysql2 gem for Rails. When I try to install it by running bundle install or gem install mysql2 it gives me the following error:
安装 mysql2 时出错:错误:无法构建 gem 本机扩展.
Error installing mysql2: ERROR: Failed to build gem native extension.
如何解决这个问题并成功安装mysql2?
How can I fix this and successfully install mysql2?
在 Ubuntu/Debian 和其他使用 aptitude 的发行版上:
On Ubuntu/Debian and other distributions using aptitude:
sudo apt-get install libmysql-ruby libmysqlclient-dev
包libmysql-ruby 已被淘汰并由ruby-mysql 取代.这里是我找到解决方案的地方.
Package libmysql-ruby has been phased out and replaced by ruby-mysql. This is where I found the solution.
如果上面的命令因为找不到libmysql-ruby而不起作用,那么以下应该就足够了:
If the above command doesn't work because libmysql-ruby cannot be found, the following should be sufficient:
sudo apt-get install libmysqlclient-dev
在 Red Hat/CentOS 和其他使用 yum 的发行版上:
On Red Hat/CentOS and other distributions using yum:
sudo yum install mysql-devel
在带有 Homebrew 的 Mac OS X 上:
On Mac OS X with Homebrew:
brew install mysql
这篇关于安装 mysql2 时出错:无法构建 gem 本机扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
如何有效地使用窗口函数根据 N 个先前值来决定How to use windowing functions efficiently to decide next N number of rows based on N number of previous values(如何有效地使用窗口函数根据
在“GROUP BY"中重用选择表达式的结果;条款reuse the result of a select expression in the quot;GROUP BYquot; clause?(在“GROUP BY中重用选择表达式的结果;条款?)
Pyspark DataFrameWriter jdbc 函数的 ignore 选项是忽略整Does ignore option of Pyspark DataFrameWriter jdbc function ignore entire transaction or just offending rows?(Pyspark DataFrameWriter jdbc 函数的 ig
使用 INSERT INTO table ON DUPLICATE KEY 时出错,使用 Error while using INSERT INTO table ON DUPLICATE KEY, using a for loop array(使用 INSERT INTO table ON DUPLICATE KEY 时出错,使用 for 循环数组
pyspark mysql jdbc load 调用 o23.load 时发生错误 没有合pyspark mysql jdbc load An error occurred while calling o23.load No suitable driver(pyspark mysql jdbc load 调用 o23.load 时发生错误 没有合适的
如何将 Apache Spark 与 MySQL 集成以将数据库表作为How to integrate Apache Spark with MySQL for reading database tables as a spark dataframe?(如何将 Apache Spark 与 MySQL 集成以将数据库表作为