5

我正在尝试在 linux 上安装 gem,但它给了我一个错误:

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

我现在需要做什么?

4

2 回答 2

16

Probably, it can't build mysql2 native extension.

If you're using Ubuntu 14.04 or newer, try sudo apt-get install ruby-mysql libmysqlclient-dev.

On older versions of Ubuntu install this: sudo apt-get install libmysql-ruby libmysqlclient-dev

On OS X: brew install mysql

There are also similar questions: 1, 2, 3.

于 2012-08-10T10:36:24.890 回答
0

我正在使用 LInux 16 Cinnamon 并收到该错误消息。我使用“Resure”的解决方案 sudo apt-get install libmysql-ruby libmysqlclient-dev

然后为项目运行捆绑安装。

有效!

于 2014-07-21T03:12:06.683 回答