Thursday, 18 June 2009

The ridiculous task of installing Gitorious

I can accept I don't know anything about Linux, but the process of installing Gitorious is getting downright ridiculous. The help file for Ubuntu is badly outdated and documentation is non-existent (or I just couldn't find any). There are so many dependencies and tools required that you seem to have to fix everything by hand. I tried following the instructions in gitorious/doc/recipes/install-ubuntu.txt except for installing Ruby Enterprise. Here's a partial list of stuff I have so far done on top of that:

1. I have installed by hand the next apt packages (aptitude install), some were not mentioned some didn't install correctly on first try: apache2-dev, mysql, imagemagick, libopenssl-ruby, rubygems1.8, ruby1.8-dev, libmagickwand-dev, libaspell-dev, aspell-en.

2. mysql didn't start so I had to do "set LD_LIBRARY_PATH=/usr/lib" and uncomment "skip-innodb" from /etc/mysql/my.cnf

3. I also had to update rake because the version in Jaunty was buggy. Fortunately Karmic has a working version, so:
  • cd /etc/apt
  • cp sources.list sources.list.jaunty
  • sed -i 's/jaunty/karmic/" sources.list
  • aptitude update
  • aptitude install rake
  • mv sources.list sources.list.karmic
  • ln -s sources.list.jaunty sources.list
  • aptitude update
4. I had to install a number of gems (gem install) that were not listed in the recipe: mysql, hoe, json, stomp, rdiscount, diff-lcs, oauth, stompserver, raspell.

5. I fixed gitorious.yml by copying contents of test section to production section and made sure the values are correct.

6. /etc/init/init.d/git-daemon needed to be fixed becaus GIT_DAEMON pointed to wrong directory.

7. I had to chmod 777 /var/www/gitorious/log/message_processing.log.

8. In /var/www/gitorious/config: cp broker.yml.example broker.yml .

9. Aspell was missing ap.multi file, so: cp /var/www/gitorious/vendor/plugins/ultrasphinx/examples/ap.multi /usr/lib/aspell . Link

10. Still problems with Ultrasphinx, so: echo "lapse" | aspell --lang=en create master ap.rws . Link

11. I installed Stompserver at this point and configured and started it (hopefully) since this link says it's needed. I don't know how else to run it, so I did this: /usr/bin/ruby /var/www/gitorious/log/stompserver -p 61613 -b 0.0.0.0 & . It also says about the need for memcached but I'm not so sure I need that because at least it seems like the requests are forwarded from Apache to Gitorious correctly.

12. I had to remove these lines from /var/www/gitorious/app/views/layouts/second_generation/application.html.erb:

<%= text_field_tag :q, params[:q], :id => "main_menu_search_form_query", :class => "unfocused", %>



because this was causing an exception.

These were of course mostly on top of the stuff said in the recipe. Some of this stuff was probably not needed, but then again it's impossible to know this.

Now I'm stuck trying to configure Ultrasphinx some more as I suspect this might be the problem. But if I try to any rake commands with Ultrasphinx (like rake ultrasphinx:index) I just get this trace:

rake aborted!
no such file to load -- echoe
/var/www/gitorious/vendor/plugins/ultrasphinx/Rakefile:2:in `require'
/var/www/gitorious/vendor/plugins/ultrasphinx/Rakefile:2
/usr/lib/ruby/1.8/rake.rb:2359:in `load'
/usr/lib/ruby/1.8/rake.rb:2359:in `raw_load_rakefile'
/usr/lib/ruby/1.8/rake.rb:1993:in `load_rakefile'
/usr/lib/ruby/1.8/rake.rb:2044:in `standard_exception_handling'
/usr/lib/ruby/1.8/rake.rb:1992:in `load_rakefile'
/usr/lib/ruby/1.8/rake.rb:1976:in `run'
/usr/lib/ruby/1.8/rake.rb:2044:in `standard_exception_handling'
/usr/lib/ruby/1.8/rake.rb:1974:in `run'
/usr/bin/rake:28


Problem is, echoe is installed (gem list --local).

In any case, currently there are no errors in production.log (under gitorious) and this in apache's log:

[ pid=22272 file=ext/apache2/Hooks.cpp:470 time=2009-06-18 14:21:37.964 ]:
Forwarding / to PID 24930
[ pid=22264 file=ext/common/StandardApplicationPool.h:405 time=2009-06-18 14:31:01.785 ]:
Cleaning idle app /var/www/gitorious (PID 24930)
[ pid=22264 file=ext/common/Application.h:448 time=2009-06-18 14:31:01.787 ]:
Application 0x80a3498: destroyed.


The last part seems ok, the app is just killed if there is no action for some time. It is automatically restarted when I refresh the front page (this and a few of the pages work, mostly either nothing happens or I get the "Failed to Connect" page).

The most problematic thing is I don't know how this is supposed to work so I can't really use any systematic approach to solving these problems. So I don't honestly know if I will be able to install Gitorious at all in the end. There are still a lot of stuff I'm not too sure will work, like the actual connection to git. In conclusion it looks like you don't want to install any software that uses Ruby on Rails unless you know RoR already. There is bound to be problems with missing gems, errors when migrating them and so on and everything is dependand on all of the sw components being available and being the correct version: rake, correct version of Ruby (1.8 and 1.9 don't seem to completely compatible) etc.

Redmine at least had a Bitnami stack which made the installation seem almost ridiculously easy in comparison, I'm guessing if I have to install it from scratch it'll be a similar experience.

9 comments:

  1. I'm in the middle of the Gitorious install battle as well, unfortunately you didn't list the problem I'm seeing.

    Has something to do with the repository_base_path. Who knows. But I agree the documentation is horrid. I've started looking at the auto install script they link to on github, but that still doesn't get things to work for me.


    Good luck.

    ReplyDelete
  2. Hey Guys,

    have you tried your luck on gitorious group (groups.google.com/group/gitorious). In my opinion, the guys from gitorious.org are very eager in helping out when problems occure.

    Greets, Thomas.

    ReplyDelete
  3. Yes, I have been there and on the IRC channel (#gitorious at irc.freenode.net). I agree that the guys are very helpful, even more so on IRC.

    I have some more recent blog posts about the installation which show it is now much easier to do than just two months ago.

    ReplyDelete
  4. Has anyone found links to verified instructions or a working installation script for ubuntu 9.10, working from scratch?

    ReplyDelete
  5. Have you already tried this: http://cjohansen.no/en/ruby/setting_up_gitorious_on_your_own_server ?

    It was written for 9.04, but has something changed so much that those instructions don't work any more?

    ReplyDelete
  6. Grrrrrrrr Just Wasted Soooo Long Trying to do this..

    Most of the guides don't include gem version numbers.. so when they write the guide it works great cause its the latest, but 6 months later where a gem has updated but the dependancies for havent been updated the guide is completely useless!

    ReplyDelete
  7. It would be really great if someone could provide a full installed gitorious into a vmware or virtualbox image.
    It makes no sense that every one has to feel the pain again and again!

    ReplyDelete
  8. Here's a good tutorial for Ubuntu 10.04. I followed it and ran into issues only toward the end. Google got me through them. I had to uninstall a gem (i18n) and let Ruby use the version of that gem included with Gitorious. Also, the Stomp server wasn't running when I was done going through the tutorial, so I had to sudo /etc/init.d/stomp start. There may have been another couple issues, but those were the biggies. Good luck!

    ReplyDelete
  9. Would help to include the link, wouldn't it?

    http://www.bluequartz.net/projects/ElectronicImaging/SCMService/html/gitorious___ubuntu__setup.html

    ReplyDelete