A few notes from my experience installing Gitorious on Ubuntu Maverick 10.10. I used soundmaster’s fork of the gitorious-ubuntu-sprinkle script. I used ruby 1.8 and rubygems from the Ubuntu repository.
Edit Config Files
The sprinkle readme doesn’t mention it, but you need to edit the config files before running. Add your mysql password to config/database.yml and change your hostname and email in config/gitorious.yml.
Beware that if the script already installed the files to /var/www/gitorious/config it won’t overwrite the existing files, so you will need to make your changes to the files at /var/www/gitorious/config (or delete the files and re-run the sprinkle script).
Sprinkle Script Overview
The sprinkle script will
- Install required gems
- Download and configure gitorious
- Install and start startup scripts (stomp, git-poller, git-daemon)
- Setup gitorious mysql database
- Create a user named “git” (whose home dir is /var/www/gitorious)
- Setup apache for use with gitorious
Deciphering Errors
I had a bunch of problems running
bundle exec sprinkle -s gitorious.rb
Ruby/capistrano spits out some long error messages, which you have to decipher to figure out which line in gitorious.rb failed to run.
Bundle couldn’t install the latest version of echoe (0.4.6) because Ubuntu’s rubygems (1.3.7) isn’t recent enough, so I installed an older version of echoe.
sudo gem install echoe -v="0.4.5"
I then removed echoe from the list of gitorious_dependencies in gitorious.rb. In hindsight, I think I could have added an entry to Gemfile specifying the echoe version, but I’m a Ruby noob, and just hacked the script to get it to work.
Then Rake couldn’t setup my database (some error about having activated rake 1.9.1 but the script required rake 1.8.7). Turns out I need to call bundle exec rake instead of /var/lib/gems/1.8/bin/rake. I modified the lines in gitorious.rb:
#post :install, 'su - git -c "/var/lib/gems/1.8/bin/rake db:setup RAILS_ENV=production"' post :install, 'su - git -c "bundle exec rake db:setup RAILS_ENV=production"'
Miscellaneous notes
Make sure your server is getting ports 80 and 443 (for ssl).
I also had to set up my server to properly route email so that Gitorious could send emails (e.g. registration confirmation). I used this guide to setup postfix to route mail through Gmail’s smtp.