UPDATE 01/23/2012: This post continues to get a large amount of traffic and, unfortunately, is very out of date! I would update this post to bring it up to date, but it turns out that is completely unnecessary. The fine folks behind GitLab have added impressive install scripts (and even more impressive documentation!) for installation of GitLab on an Ubuntu box. I recently utilized them to get a v2.0 GitLab install up and running and the experience was painless. This even included getting it running on nginx, and more importantly, port 80. I will leave the body of this post here for posterity’s sake, but it is no longer any sort of authoritative source.
Installing GitLab has turned out to be quite a chore and, as a result, I wanted to provide a solid tutorial on how to get it all functioning correctly. This post will only cover what the installation instructions do: getting it to work with the built in server. I plan to do another post on how to get it running on Apache.
Install Ruby 1.9.2, RubyGems, and Rails
The instructions for this step are pretty solid, but I was never able to get the checkinstall portion to work. Luckily, I found something that works. You will likely note the use of “aptitude” instead of “apt-get”; please use “aptitude”. It appears to have packages “apt-get” does not.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | |
Install GitLab
1 2 3 4 5 6 7 8 | |
Uninitialized constant Rake::DSL?
This was an error I hit every single time I installed GitLab (it took several attempts). For whatever reason, the “rake db:setup” call yielded an error of “unititialized constant Rake::DSL”. Thanks to some Googling and a particularly useful StackOverflow question, I found a solution: open the Rakefile at the root of gitlabhq and add these two lines to the file just beneath the comments:
1 2 | |
Setup the database
With that issue resolved, you should be able to invoke the commands to setup the database now:
1 2 | |
Install Gitosis
The user we add in this step will be the user that gitosis runs under. During the keygen step, simply accept the defaults for all fields.
1 2 3 4 5 6 7 8 9 10 | |
Start the Server
1
| |
Test your installation
If all went well, you should be able to connect to the server at: http://localhost:3000/. The default login info is as follows:
1 2 | |
Be aware that upon creation of your first git repo or when you add your first public key, you will have to type “yes” on the server to confirm the ssh key that you made earlier.
Good luck with your new GitLab install!