<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Paul On Rails: Category Hacks</title>
    <link>http://paulonrails.com/articles/category/hacks</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Paul's thoughts on Rails</description>
    <item>
      <title>soap4r is Evil! Part 2</title>
      <description>&lt;p&gt;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.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;# 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 &amp;lt;&amp;lt; "#{RAILS_ROOT}/vendor/gems"
 Gem.source_index.refresh!
 gem 'soap4r'
# done with hack for http://dev.ctor.org/soap4r/ticket/433#comment:6
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;</description>
      <pubDate>Mon, 22 Oct 2007 14:54:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:5541e6ae-bb69-4188-a268-2a24ae5d7e9c</guid>
      <author>Paul Haddad</author>
      <link>http://paulonrails.com/articles/2007/10/22/soap4r-is-evil-part-2</link>
      <category>Hacks</category>
      <category>soap4r</category>
      <category>Hack</category>
      <category>workaround</category>
      <category>bug</category>
      <category>sucks</category>
    </item>
    <item>
      <title>soap4r is Evil!</title>
      <description>&lt;p&gt;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&amp;#8217;d write/vent about that instead.&lt;/p&gt;


	&lt;p&gt;The problem is if soap4r is installed as a gem it tends to kill anything that doesn&amp;#8217;t have &lt;code&gt;require 'soap4r'&lt;/code&gt; installed at the very top of environment.rb.  This is detailed in the this &lt;a href="http://dev.ctor.org/soap4r/ticket/433"&gt;bug&lt;/a&gt;.  Even though its marked as invalid I think the soap4r guys really should do something about it.&lt;/p&gt;


	&lt;p&gt;Anyways until this is fixed and because I didn&amp;#8217;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.&lt;/p&gt;


	&lt;p&gt;From &lt;span class="caps"&gt;RAILS&lt;/span&gt;_ROOT&lt;/p&gt;


&lt;code&gt;gem install -i vendor/gems soap4r&lt;/code&gt;

	&lt;p&gt;This causes the gem to get installed into vendor/gems.  Note I don&amp;#8217;t think there&amp;#8217;s a way to uninstall the plugin via gem, but for now it&amp;#8217;ll do.&lt;/p&gt;


	&lt;p&gt;Continuing on, I added the following right after the &lt;code&gt;require 'rubygems'&lt;/code&gt; line in boot.rb.&lt;/p&gt;


&lt;code&gt;Gem.path &amp;lt;&amp;lt; "#{RAILS_ROOT}/vendor/gems"&lt;/code&gt;

	&lt;p&gt;and then I just have the standard &lt;code&gt;require 'soap4r'&lt;/code&gt; at the top of requirement.rb.&lt;/p&gt;


	&lt;p&gt;Not what I&amp;#8217;d call the most elegant solution to this problem, but it should work for our env.&lt;/p&gt;</description>
      <pubDate>Fri, 19 Oct 2007 08:00:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:746ef9ed-bc56-4a6a-a453-0a9d1e83c518</guid>
      <author>Paul Haddad</author>
      <link>http://paulonrails.com/articles/2007/10/19/soap4r-is-evil</link>
      <category>Hacks</category>
      <category>soap4r</category>
      <category>Hack</category>
      <category>workaround</category>
      <category>bug</category>
      <category>sucks</category>
    </item>
  </channel>
</rss>
