执行命令:visudo
把/usr/local/bin加入到secure_path里面去
然后,配置git用户可以使用sudo
git ALL=(ALL) ALL
5、安装mysql
yum install mysql mysql-devel mysql-server -y
/etc/init.d/mysqld start
mysql_secure_installation
创建gitlab 数据库用户
CREATE USER 'gitlab'@'localhost' IDENTIFIED BY 'gitlab';
CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gitlabhq_production`.* TO 'gitlab'@'localhost';
\q
6、安装redis
mkdir /tools/redis && cd /tools/redis
wget http://download.redis.io/releases/redis-3.0.3.tar.gz
tar xzf redis-3.0.3.tar.gz
cd redis-3.0.3
make
5)修改Gemfile
vim Gemfile
修改source为 http://ruby.taobao.org
sed -i s#https://rubygems.org#http://ruby.taobao.org#g Gemfile
安装node.js
8、bundle install
bundle install --no-deployment --without development test postgres aws
中途如果不出意外的话,就安装完成(install中途可能要提示输入密码)
如果提示下面的错误:
--------------------------------------------------------------------------------------------
An error occurred while installing charlock_holmes (0.6.9.4), and Bundler cannot continue.
Make sure that `gem install charlock_holmes -v '0.6.9.4'` succeeds before bundling.
gem install charlock_holmes -v '0.6.9.4'
ERROR: Could not find a valid gem 'charlock_holmes' (= 0.6.9.4), here is why:
Unable to download data from https://rubygems.org/ - Errno::ECONNRESET: Connection reset by peer - SSL_connect (https://api.rubygems.org/quick/Marshal.4.8/charlock_holmes-0.6.9.4.gemspec.rz)
ERROR: Possible alternatives: charlock_holmes
yum install libicu-devel
--------------------------------------------------------------------------------------------
An error occurred while installing rugged (0.21.4), and Bundler cannot continue.
Make sure that `gem install rugged -v '0.21.4'` succeeds before bundling.
--------------------------------------------------------------------------------------------
如果提示下面的错误:
rake aborted!
ExecJS::RuntimeUnavailable: Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes.
/home/git/gitlab/config/application.rb:6:in `<top (required)>'
/home/git/gitlab/Rakefile:5:in `require'
/home/git/gitlab/Rakefile:5:in `<top (required)>'
(See full trace by running task with --trace)
System information
System:
Current User: git
Using RVM: no
Ruby Version: 2.1.5p273
Gem Version: 2.2.2
Bundler Version:1.10.6
Rake Version: 10.4.2
Sidekiq Version:3.3.0
GitLab information
Version: 7.9.2
Revision: c46d4f5
Directory: /home/git/gitlab
DB Adapter: mysql2
URL: http://10.1.7.201
HTTP Clone URL: http://10.1.7.201/some-project.git
SSH Clone URL: git@10.1.7.201:some-project.git
Using LDAP: no
Using Omniauth: no