http://zx-1986.blogspot.com/2012/03/setup-gitlab-in-rhel-6.html
this note was out of date! please check the update version:
http://zx-1986.blogspot.com/2012/03/setup-gitlab-in-rhel-6.html
作業系統:RHEL 6.0 i386
cd /opt wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm && rpm -i *.rpm yum groupinstall "Development Tools" # thanks for http://dejant.blogspot.com yum install libxml2-devel libxslt-devel # thanks for http://dejant.blogspot.com yum install git libxml2 libxslt sqlite sqlite-devel openssl zlib mysql++-devel mysql++ readline-devel compat-readline5 readline libcurl libcurl-devel libstdc++ libstdc++-devel libstdc++-docs compat-libstdc++-33 yum install python-pip pip-python install pygments # yum install python-setuptools # easy_install pygments adduser gitlabhq passwd gitlabhq visudo # gitlabhq ALL=(ALL) NOPASSWD: ALL sudo bash < <(curl -s https://rvm.beginrescueend.com/install/rvm) # using sudo for multi-users installed! # logout, then login as root again rvm install 1.9.2 rvm --default use 1.9.2 ruby --version echo "gem: --no-rdoc --no-ri" > ~/.gemrc gem update --system gem install bundler echo $rvm_path/src/$(rvm tools strings) rvm @global gem install ruby-debug19 -- --with-ruby-include=$rvm_path/src/$(rvm tools strings) exit
su - gitlabhq ssh-keygen -t rsa sudo yum install gitosis sudo adduser -r -s /bin/sh -c 'git version control' -U -m git sudo usermod -a -G git gitlabhq sudo usermod -a -G rvm gitlabhq sudo -H -u git gitosis-init < /home/gitlabhq/.ssh/id_rsa.pub sudo chmod 755 /home/git sudo chmod 755 /home/git/repositories/gitosis-admin.git/hooks/post-update cd ~ git clone https://github.com/gitlabhq/gitlabhq.git cd gitlabhq vim Gemfile # :%s/git:/https:/g vim Gemfile.lock # :%s/git:/https:/g sudo su - cd /home/gitlabhq/gitlabhq bundle install # run the "bundle install" as "root" to avoid the permission issue at first time cd /usr/local/rvm/gems/ruby-1.9.2-p290/bundler/gems mv ./* /tmp exit bundle install # run the "bundle install" as "gitlabhq" to make sure all gems in gitlabhq/ grant to "gitlabhq" bundle exec rake db:setup RAILS_ENV=production bundle exec rake db:seed_fu RAILS_ENV=production vim config/gitosis.yml # 檢查內容與路徑 rails s -e production # 啟動測試服務器
測試網址
http://localhost:3000
預設的帳號密碼
admin@local.host / 5iveL!fe
# 設定 Nginx
sudo su - yum remove httpd gem install passenger passenger-install-nginx-module # 選擇 1. Yes: download, compile and install Nginx for me. (recommended) # passenger-install-nginx-module 會自動下載并編譯安裝 Nginx,預設裝到 /opt/nginx vim /opt/nginx/conf/nginx.conf --- user gitlabhq; server { listen 80; server_name YOUR_IP_ADDRESS; root /home/gitlabhq/gitlabhq/public; passenger_enabled on; } --- /opt/nginx/sbin/nginx # start Nginx server /opt/nginx/sbin/nginx -s stop # stop Nginx server
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
done!
回覆刪除Please include EPEL repository as well as RHEL 'optional' repo to install python-pip
回覆刪除I was unable to build ruby 1.9, Please include build tools: yum groupinstall "Development Tools"
回覆刪除Several libraries are missing for building nokogiri on line 75 (bundle install) I fixed it by doing yum install libxml2-devel libxslt-devel
回覆刪除thank you so much for correcting!
回覆刪除I'm using EPEL 6!
http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
Still same error as before, AFter creating a new project, I get 500 error. The project is created but when I navigate to its pagethis error occurs.
回覆刪除Completed 500 Internal Server Error in 7ms
ActionView::Template::Error (undefined method `highlight' for nil:NilClass):
you mean the project was created in /home/git/repositories ?
回覆刪除or just created on the Gitlab web page ?
if it just created on the web page,
it was just wrote some info about project on the sqlite database of Gitlab.
you have to make sure it could create in /home/git/repositroies
sudo usermod -a -G git gitlabhq
sudo usermod -a -G rvm gitlabhq
sudo chmod 755 /home/git
su - gitlabhq
ssh your_server # say yes to the SSH key vaild
did you run Nginx using gitlabhq account ?
I mean:
add "user gitlabhq;" in /opt/nginx/conf/nginx.conf
oh! and run bundle install as gitlabhq
回覆刪除su - gitlabhq
cd /home/gitlabhq/gitlabhq
bundle install
bundle exec rake db:setup RAILS_ENV=production
bundle exec rake db:seed_fu RAILS_ENV=production
rails s -e production
we have to make sure Gitlabhq works fine first,
then we could move it to Nginx.
Thanks, my project exists on the webpage as a record, so I assume its in the DB, but when I check /home/git/repositroies it not in there.
回覆刪除I tried 'bundle install' as a gitlabhq user and it stops here:
Using annotate (2.4.1.beta1) from git://github.com/ctran/annotate_models.git (at master)
Errno::EPERM: Operation not permitted - /usr/local/rvm/gems/ruby-1.9.2-p290/bundler/gems/annotate_models-cfeec96c9ca0/bin/annotate
An error occured while installing annotate (2.4.1.beta1), and Bundler cannot continue.
Make sure that `gem install annotate -v '2.4.1.beta1'` succeeds before bundling.
Why are you running bundle install two times are gitlabhq and root user?
I have deleted /usr/local/rvm/gems/ruby-1.9.2-p290/bundler/gems/annotate_models-cfeec96c9ca0/ and re-ran bundle install, now it completes successfully.
回覆刪除but still see the error: http://stackoverflow.com/questions/8070065/undefined-method-highlight-pythonpygments
OK fixed with yum install python-devel, there was a linker error.
回覆刪除Just to confirm, do you see your project inside /home/git/repositories after you create the project from the gitlab?
回覆刪除My new issue is whenever I do
git push -u origin master
I see git@git.otn.local's password:
But didn't set a password for user git.
oh! sorry! my fault!
回覆刪除Gitlab won't create a git repo after we just create a project in Gitlab web.
the git repo will create when we do the first git push to it!
I'm so sorry, my mistake.
---
the "git" account was not allow to login default.
see this:
sudo adduser -r -s /bin/sh -c 'git version control' -U -m git
the -r option is:
-r This flag is used to create a system account.
---
the error when you do:
git push -u origin master
I think that was a SSH key check error,
have you done the command below ?
sudo -H -u git gitosis-init < /home/gitlabhq/.ssh/id_rsa.pub
Why are you doing 'bundle install' twice one for root and one for gitlabhq?
回覆刪除hey, dejan!
回覆刪除I dong "bundle install" twice due to:
the first time I run that command as "root", everything goes fine.
the second time I run that command as "gitlabhq",
everything goes fine.
but IF I run as "gitlabhq" at first time,
I will get lots of permission error.
so I did it once as root to get these gems I need.
I am running into issues with linecache19.
回覆刪除http://d.pr/T6Jm
Any ideas?
@Hutch
回覆刪除run this command before you install linecache19:
rvm @global gem install ruby-debug19 -- --with-ruby-include=$rvm_path/src/$(rvm tools strings)
gem install linecache19
after I git pull to get the version:
回覆刪除commit 21d566ea76bbdbfd943b946f714eac1cfd94546b
Merge: 7ebba27 d61268e
Author: Dmitriy Zaporozhets
Date: Tue Nov 22 23:52:15 2011 +0200
Merge branch 'master' of dev.gitlabhq.com:gitlabhq
I link to http://my.gitlabhq.com/project/master/tree
I got 404 error
but link to http://my.gitlabhq.com/project/659948890ef3143c056f0b64691e8db499918bfe/tree
things just fine.
that's all my fault ....
回覆刪除after git pull or update, remember to do this:
bundle exec rake db:migrate RAILS_ENV=production