---
title: "GitLab 安装问题小记"
author: "snowolf"
date: "2013-03-21T11:35:22Z"
tags: []
categories: ["开源软件"]
slug: "gitlab"
draft: false
lastmod: "2013-03-21T11:36:55Z"
id: 1833229
url: "https://snowolf.iteye.com/blog/1833229"
---

GitLab是个好东西，但就是安装起来忒费劲。

参考[官方文档](https://github.com/gitlabhq/gitlabhq/blob/stable/doc/install/installation.md)，使用Ubuntu+MySQL，难免还是会有些小问题。

 参考文档执行：

```
sudo -u gitlab -H bundle exec rake gitlab:setup RAILS_ENV=production
```

遇到：

写道

Gem files will remain installed in /home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/mysql2-0.3.11 for inspection.  
Results logged to /home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/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.

 

但当我执行

写道

gem install mysql2 -v '0.3.11'

 又会提示各种诡异错误。

 

其实是ruby与mysql直接的关联问题，解决办法：

```
sudo apt-get install libmysql-ruby libmysqlclient-dev
```