error in rails in locator.rb:91:in `add’: wrong number of arguments (3 for 1) (ArgumentError)

When I tried to start my rails-app this morning on my new server, I got:

** Starting Rails with development environment…
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/rails/plugin/locator.rb:91:in `add’: wrong number of arguments (3 for 1) (ArgumentError)

That seems to be a problem with an old install of rubygems on my Ubuntu-machine. Didn’t know that. 😦 It lives inside /usr/lib/ruby while the new versions normally reside at /usr/local/lib/site_ruby


Delete /usr/lib/ruby/1.8/rubygems.rb and /usr/lib/ruby/1.8/rubygems (the latter is a directory)

Thanks to Stephan for this article:


error with rubygems – marshal data too short

This was a strange thing. I had installed the rubygems by hand using the tar.gz from I use version 1.3.1 currently. It worked fine at first, so I installed all the gems I needed, like rails etc.

When I wanted to install some more gems today, all I got to see was:

# gem update
updating installed gems
ERROR:  While executing gem … (ArgumentError)
  marshal data too short

And this error kept popping up – no matter what commands I wanted to run with rubygems (update, update –system, install…)

I searched for a solution on google and found forums for ruby etc. Unfortunately none of these posts offered a solution to the problem – at least none, that was specific to my situation. It seems as though, this problem (mashal data too short) can occur in a lot of places, especially in databases and such. Must a an index of some kind.

Anyway, my fix was to delete everything in the ~/.gems diretory. That sets back your entire install of rubygems, because this holds information on what gems are installed an so on. But afterwards at least the “gem” command worked again. 😉

I just reinstalled all my gems. You can get a list of all installed gems with

gem list –local

This command actually worked before – thank god. 😉

All right – so much for now. Just a short incident-report. 😉

avoid downtime due to DNS-drag

Ever had this problem?

You have to switch servers for some reason and so naturally your DNS-settings have to be updated to the new IP-Adress. Well, moving the website to the new server is not the problem in itsself. The Problem is, that DNS-settings sometimes take very long to take effect. They might be right at your nameserver, but that does not mean, that your visitors get the same result for a dns-query.

Most ISPs have their own DNS-machines that cache request – and some do that for a very long time – several days. Yes, and that way possible visitors for your site experience days of downtime even though your server is running perfectly.

My solution to the problem is pragmatic, but it works:

The DNS-cache serves out my old server’s IP-Adress. And because my old server stays online for at least a week after the switch (for failsave reasons etc.) I only had to find a way to make it respond to the requests that it gets because of DNS-cache.

The clue here is not to serve the page from the old server, but to retrieve the pages and files from the new server and serve them. As I had a mongrel-cluster running on my old server, most of the config was already in place. It makes use of the Apache Proxy Configuration. You basically define your new server as the host your old server proxies for. This config might not be the most elegant way to do this, but for something that should not stay online for longer than a week, I refused to spend more time researching.

So here is the config:
For each website you want to forward, write the following into you apache-config (on SuSE a new file in /etc/apache/conf.d did the trick)

<Proxy balancer://yoursite>

<VirtualHost 123.456.334.332:80>
RewriteEngine On
RewriteRule ^/(.*)$ balancer://yoursite%{REQUEST_URI} [P,QSA,L]

As I said, this might not be the most elegant solution, but it definately does the trick. 😉

I hope, someone might find this useful. I know that it saved a few of my visitors from staring at an almost blank screen when expecting my site. 😉


It turnes out that the above is no good for multiple domains. 😦

So here is a better version:

<VirtualHost *:80>

     ProxyRequests off
     ProxyPreserveHost On
     ProxyPass /
     ProxyPassReverse /