read

Thanks to Christian Johansen for the excellent detailed instructions on setting up Gitorious here. I eventually got it working, which I would not have done without this help. Here are some notes from setting it up on the following versions:

Ubuntu Server 10.10 as a VMware VM
ruby 1.8.7 (2010-06-23 patchlevel 299) [i686-linux]
RubyGems 1.5.0
Rails 3.0.3
ActiveMQ 5.4.2
  1. I got as far as
    sudo rake gems:install
    and got the following error:
    rake aborted!
    Your config/gitorious.yml does not have an entry for your current Rails environment. Please consult config/gitorious.sample.yml for instructions.
    which I fixed by doing
    sudo rake gems:install RAILS_ENV=production
  2. Then I got an error "undefined local variable or method `version_requirements'" which had me stuck for a while (being a Rails n00b). Google eventually led me to this: https://www.redmine.org/issues/7516 and the environment.rb hack from Phillip Koebbe fixed it for me.
  3. When adding the first user, the command
    script/console
    gave me the following messages
    Loading development environment (Rails 2.3.5)
    /var/www/git.moo.li/gitorious/config/environment.rb:26:RuntimeError: Your config/gitorious.yml does not have an entry for your current Rails environment. Please consult config/gitorious.sample.yml for instructions.
    /var/www/git.moo.li/gitorious/vendor/rails/railties/lib/rails/backtrace_cleaner.rb:2:NameError: uninitialized constant ActiveSupport::BacktraceCleaner
    /var/www/git.moo.li/gitorious/vendor/rails/railties/lib/console_with_helpers.rb:5:NameError: uninitialized constant ApplicationController
    so I tried
    env RAILS_ENV=production ruby script/console
    which worked fine. Presumably I could export $RAILS_ENV=production to fix both these?
  4. I couldn't login until I'd enabled Passenger and Apache because the mongrel server on port 3000 didn't like the fact that the Gitorious login page had an https:// URL. In other words, I had to defer the user setup until I had the Passenger server working.
  5. The Passenger install only instructed me to create a passenger.load file. A passenger.conf wasn't needed.
  6. In the section on enabling some Apache modules, rewrite is enabled twice, which is unnecessary.
  7. I couldn't run the login page at first until I installed the i18n gem v0.1 - it didn't like the v0.5 version.
  8. At first I couldn't upload my public key. This seemed to be a problem with ActiveMQ. I added the following line to activemq.xml
    <transportConnector name="stomp" uri="stomp://0.0.0.0:61613"/>
    (there wasn't a stomp connector in there before). By the way, there were no networkConnectors lines in my activemq.xml so I didn't change the multicasting setup.
  9. I also did update-rc.d activemq defaults so that ActiveMQ starts at boot time.
  10. [EDITED to add:] I also found that the Sphinx cron job was causing errors. Here's what I did to fix it. Firstly, the cron job couldn't find the indexer command, so I did a crontab -e and added the following lines to the crontab.
    SHELL=/bin/sh
    PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
  11. Also, the cron rob running every minute was creating a lot of unecessary mail, so I appended  > /dev/null to the end of the line defining the job.
  12. Next the Sphinx configuration file was using the deprecated Sphinx searchd options address and port so I commented them out and added the listen option instead. I did this in both the production.conf and default.base files within the config/ultrasphinx folder of the Gitorious app. Here's what those lines in the searchd section looked like afterwards:
    #  address = 0.0.0.0
    #  port = 3312
      listen = 0.0.0.0:3312