Loading local gems in cPanel shared host

I had some trouble today figuring out why my Redmine installation wouldn’t start running on my shared server. I received the following error in my log/mongrel.log file:

** Starting Rails with production environment...
Missing the i18n 0.4.2 gem. Please `gem install -v=0.4.2 i18n`

Now, I had finally gotten rid of this problem while using SSH by running

export GEM_PATH=/home/<my username>/ruby/gems

in terminal (or adding it to .bashrc), resulting in successful rake commands and running the server with WEBrick. However, Mongrel seemed to have serious issues with loading the gems in my local files.

This should be solved by adding

ENV['GEM_PATH']= "/home/<my username>/ruby/gems:/usr/lib/ruby/gems/1.8"

to the environment.rb file, but it did not. Apparently this is because Mongrel loads rubygems by itself, ignoring any environment variables set after this. Therefore, the below fine hack by Rui Lopez found on this page, became necessary:

ENV['GEM_PATH']= "/home/<my username>/ruby/gems:/usr/lib/ruby/gems/1.8"
require 'rubygems'; Gem.clear_paths;
Gem.instance_variable_set(:@searcher, nil)

As Rui puts it himself:

[This] clears the internal cache used by rubygems, and forces it to
re-read the GEM_PATH env. variable.

As he also points out, it might not be the cleanest hack, but it works. And that makes me happy.

Moving around and going to github

I don’t think you’ll notice, but I’ve just moved this page permanently to dragly.org. There seems to have been some problems getting this site indexed properly when it was hosted on a subdomain of dragly.com. To get the site ut to speed I decided to move it. After all, what is a webpage without visitors? And how would you get here without the site being visible?

Alt text
I've found that github offers just what I need to host everything from small to big projects.

Until now we have been hosting dragly.com at One.com, but since they don’t support several domains I’m considering to move everything to ProISP.no where I’m currently hosting dragly.org. At the same time I think we’ll have to do something about those outdated webpages we’ve got there. We haven’t really updated those in a while.

On a completely different topic I’m trying out git at the moment as an alternative to Subversion. Way too many people have been talking positively about it lately, so I figured I needed to give git a shot.

First of all I’ve set up a profile over at github and am going to upload a few of my projects during the next couple of weeks. I’ve got too much source code lying around not to share it with everyone 🙂

And for starters that’s a big plus for github. Keeping my projects stored in one place makes it a much better alternative than hosting alternatives for Subversion, like SourceForge and Google Code.