GitLab on Wheezy, error while installing Gems, lib

2019-08-04 00:35发布

问题:

So, while I was installing GitLab following the official tutorial I got an error on the Gems installation.

Gem files will remain installed in /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/mysql2-0.3.11 for inspection.
Results logged to /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/mysql2-0.3.11/ext/mysql2/gem_make.out
An error occurred while installing mysql2 (0.3.11), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.3.11'` succeeds before bundling.

Looking online they say this problem comes often when some lib is missing.. and one comment confirm what I was scared of...

problem solve, type this command

sudo apt-get install libmysqlclient-dev

sudo apt-get install mysql

then run gem install mysql2

The problem is that I tried to install it but..

sudo apt-get install libmysqlclient-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package libmysqlclient-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  mysql-server-5.5

E: Package 'libmysqlclient-dev' has no installation candidate

and mysql-server-5.5 is already installed... How can I solve it?

Info: Linux 3.10.13-x86_64-jb1 #3 SMP Fri Oct 4 11:46:29 CEST 2013 x86_64 GNU/Linux

回答1:

Check your sources.list (/etc/apt/sources.list) and make sure you have these repos listed there

deb http://packages.dotdeb.org wheezy all
deb-src http://packages.dotdeb.org wheezy all

now run

sudo apt-get install libmysqlclient-dev

Then Gitlab gem will install without error too.