Difficulties installing mysql gem on Ubuntu

微笑、不失礼 提交于 2019-11-28 17:24:25
Zabba

Try this and then install the mysql gem:

sudo apt-get install libmysqlclient-dev 

If that's not sufficient try it like this

 sudo apt-get install libmysqlclient-dev libmysqlclient16 ruby-dev

Try this and then install the mysql gem:

sudo apt-get install libmysqlclient-dev libmysqlclient16

This worked after then running sudo gem install mysql.

The documentation still doesn't install correctly (heaps of "No definition" errors, although thats not really a biggie.

You should do what the error message tells you: check the mkmf.log! Search for this file using find /usr/lib/ruby/gems/1.8/gems/ -name mkmf.log. Usually, this error message appears because you forgot to install the -dev package for the extension you were trying to install. So if you wanted to install the mysql gem, you probably forgot to install the libmysqlclient14-dev first. Do an apt-cache search | grep dev to find the appropriate packages.

plz check this for more information

In my case, I had the following error message:

An error occurred while installing mysql (2.8.1), and Bundler cannot continue. Make sure that gem install mysql -v '2.8.1' succeeds before bundling.

I tried: gem install mysql -v '2.8.1', and I got an error message similar to what you got.

I fixed it doing the following:

  • STEP (1): run this: sudo apt-get install libmysqlclient-dev

  • STEP (2): install mysql: gem install mysql -v 2.8.1

You should get a success message similar to this:

Successfully installed mysql-2.8.1
Installing ri documentation for mysql-2.8.1 1 gem installed

I hope my answer helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!