2013/06/02

Ubuntu 安裝 Gitlabhq [Failed]

這是無效的筆記,請前往:
http://zx-1986.blogspot.com/2012/03/setup-gitlab-in-rhel-6.html

it does NOT WORK! please check the update version:
http://zx-1986.blogspot.com/2012/03/setup-gitlab-in-rhel-6.html

在 Ubuntu 11.04 Server 安裝 Gitlabhq

THIS IS NOT WORK!

su -
export http_proxy="your_proxy"
export https_proxy="your_proxy"
apt-get update && apt-get upgrade

# 設定 Ruby 環境

apt-get install git-core curl gcc checkinstall make build-essential 
apt-get install libxml2-dev libxslt-dev sqlite3 libsqlite3-dev libcurl4-openssl-dev libreadline5-dev libc6-dev libssl-dev libmysql++-dev zlib1g-dev
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
source /etc/bash.bashrc
rvm install 1.9.2
rvm install 1.9.3
rvm --default use 1.9.2
gem update --system
echo "gem: --no-rdoc --no-ri" > ~/.gemrc

注意:使用的是 rvm 管控下的 Ruby 1.9.2 與其搭配的 rubygems

# 安裝 Gitosis

apt-get install git gitosis
adduser --system --shell /bin/sh --gecos 'git version control' --group --disabled-password --home /home/git git
ssh-keygen -t rsa
sudo -H -u git gitosis-init < ~/.ssh/id_rsa.pub
chmod 755 /home/git/repositories/gitosis-admin.git/hooks/post-update
# 安裝 Gitlabhq
cd /opt
pip install pygments
apt-get install python-setuptools
easy_install pygments
apt-get install libsqlite3-dev
gem install bundler
git clone https://github.com/gitlabhq/gitlabhq.git
cd gitlabhq
vim Gemfile # :%s/git:/https:/g
vim Gemfile.lock # :%s/git:/https:/g
echo $rvm_path/src/$(rvm tools strings) 
rvm @global gem install ruby-debug19 -- --with-ruby-include=$rvm_path/src/$(rvm tools strings)
bundle install
bundle exec rake db:setup RAILS_ENV=production
bundle exec rake db:seed_fu RAILS_ENV=production
vim /opt/gitlabhq/config/gitosis.yml  # 檢查內容與路徑
rails s -e production # 啟動測試服務器
測試網址 http://localhost:3000 預設的帳號密碼 admin@local.host / 5iveL!fe # 安裝 Nginx
apt-get autoremove apache2*
dpkg --purge apache2*
apt-get install nginx
gem install passenger
passenger-install-nginx-module

# 選擇 1. Yes: download, compile and install Nginx for me. (recommended)
# passenger-install-nginx-module 會自動下載并編譯安裝 Nginx,預設裝到 /opt/nginx
設定 Nginx 當作 Gitlabhq 的 Server
vim /opt/nginx/conf/nginx.conf

===
user root;

server {
  listen 80;
  server_name gitlabhq;
  root /opt/gitlabhq/public;
  passenger_enabled on;
}
===

Reference:
http://isitruby19.com/linecache19
https://github.com/carlhuda/bundler/issues/1356
https://github.com/mark-moseley/linecache/issues/8
https://github.com/gitlabhq/gitlabhq/issues/66
https://github.com/gitlabhq/gitlabhq/issues/34
https://github.com/gitlabhq/gitlabhq/issues/84
https://github.com/gitlabhq/gitlabhq/issues/141

5 則留言:

  1. Hi, did you have success with this setup on Ubuntu? or are these still issues with the configuration of gitlabhq?

    回覆刪除
  2. still issues ....

    when I run: rails s -e production
    gitlabhq web could not create project in /home/git/repositories

    but gitlabhq could modify /home/git/.gitosis.conf

    it seems gitlabhq could not create bare git repository in /home/git/repositories

    I think I have better to study the mechanism of gitosis

    回覆刪除
  3. it works in RHEL 6 i386!

    check this out:
    http://zx-1986.blogspot.com/2011/11/gitlabhq-in-redhat.html

    回覆刪除
  4. 我在Ubuntu下还是无法添加project

    回覆刪除
  5. 我重新測試安裝看看,Gitlab 最近有更新了。

    回覆刪除