soap4r is Evil!

Posted by Paul Haddad Fri, 19 Oct 2007 15:00:00 GMT

I was going to talk about setting up rails at MediaTemple, but I just wasted a good portion of yesterday dealing with soap4r. So I figured I’d write/vent about that instead.

The problem is if soap4r is installed as a gem it tends to kill anything that doesn’t have require 'soap4r' installed at the very top of environment.rb. This is detailed in the this bug. Even though its marked as invalid I think the soap4r guys really should do something about it.

Anyways until this is fixed and because I didn’t want to modify some perfectly fine apps, I had to come up with a workaround, perhaps there is a better way to do this, but this is what I came up with.

From RAILS_ROOT

gem install -i vendor/gems soap4r

This causes the gem to get installed into vendor/gems. Note I don’t think there’s a way to uninstall the plugin via gem, but for now it’ll do.

Continuing on, I added the following right after the require 'rubygems' line in boot.rb.

Gem.path << "#{RAILS_ROOT}/vendor/gems"

and then I just have the standard require 'soap4r' at the top of requirement.rb.

Not what I’d call the most elegant solution to this problem, but it should work for our env.

Posted in  | Tags , , , ,  | no comments

Comments

(leave url/email »)

   Preview comment