Posted by Paul Haddad
Mon, 22 Oct 2007 21:54:00 GMT
So more time wasted on this gem. Turns out my previous fix didn't work with the console. The problem is console doesn't seem to load in the boot.rb on startup, at least the irb process doesn't. Fortunately I was able to come up with a better fix that doesn't depend on modifying boot.rb in anyway.
# this is here for bug http://dev.ctor.org/soap4r/ticket/433#comment:6
require 'rubygems'
RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
Gem.path << "#{RAILS_ROOT}/vendor/gems"
Gem.source_index.refresh!
gem 'soap4r'
# done with hack for http://dev.ctor.org/soap4r/ticket/433#comment:6
The idea here is pretty much the same as before, the only real difference is the refresh! call which causes the gems to be re-looked at. The RAILS_ROOT bit is just there because since console doesn't call boot.rb it won't be defined otherwise.
One more issue I ran into is that on a newly installed machine I didn't have the httpclient gem installed. So just made sure that was added in my vendors/gems directory and all is good.
Posted in Hacks | Tags bug, Hack, soap4r, sucks, workaround | no comments
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 Hacks | Tags bug, Hack, soap4r, sucks, workaround | no comments