<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>humandoing software &#187; ruby</title>
	<atom:link href="http://blog.humandoing.net/tag/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.humandoing.net</link>
	<description>better software for everyone</description>
	<lastBuildDate>Sun, 22 Aug 2010 00:17:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Paperclip Problems</title>
		<link>http://blog.humandoing.net/2008/10/17/paperclip-problems/</link>
		<comments>http://blog.humandoing.net/2008/10/17/paperclip-problems/#comments</comments>
		<pubDate>Fri, 17 Oct 2008 09:19:00 +0000</pubDate>
		<dc:creator>Daniel Wintschel</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://humandoing.net/past/2008/10/17/paperclip_problems/</guid>
		<description><![CDATA[I&#8217;ve started to use Paperclip on a pet project I&#8217;m working on (a recommendation from Josh Owens), and the API is great, except for the fact that I couldn&#8217;t get it to work. Files were being uploaded fine, but my thumbnail and other variations were not generating. The documentation says that the whiny_thumbnails option defaults [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve started to use <a href="http://github.com/thoughtbot/paperclip/tree/master">Paperclip</a> on a pet project I&#8217;m working on (a recommendation from <a href="http://josh.the-owens.com/">Josh Owens</a>), and the <span class="caps">API</span> is great, except for the fact that I couldn&#8217;t get it to work.</p>
<p>Files were being uploaded fine, but my thumbnail and other variations were not generating. The documentation says that the <code>whiny_thumbnails</code> option defaults to true, but my reality seems to dictate otherwise.</p>
<p>After I added that&#8230;</p>
<pre><code>has_attached_file :receipt, <br/>                  :styles =&gt; { :medium =&gt; "600x600&gt;", :thumb =&gt; "100x100&gt;" }, <br/>                  :whiny_thumbnails =&gt; true<br/></code></pre>
<p>&#8230;I was at least getting an error:</p>
<pre><code>/tmp/stream.13496.0 is not recognized by the 'identify' command.</code></pre>
<p>At long last, I figured that the error message is totally inaccurate. What it really meant is &#8220;I&#8217;m looking for &#8216;identify&#8217; in <code>/usr/bin</code> instead of <code>/opt/local/bin</code> even though <code>/opt/local/bin</code> is in your user path&#8221;.</p>
<p>For fixing:</p>
<pre><code>cd /usr/bin<br/>sudo ln -s  /opt/local/bin/convert convert<br/>sudo ln -s  /opt/local/bin/identify identify<br/></code></pre>
<p>You&#8217;ll probably only have this problem if you installed ImageMagick via MacPorts (as I did). I probably could have fixed it by adding <code>/opt/local/bin</code> to the <code>$PATH</code> used by the web server user, but whatever. This worked.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.humandoing.net/2008/10/17/paperclip-problems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sustainable Software Development</title>
		<link>http://blog.humandoing.net/2008/03/29/sustainable-software-development/</link>
		<comments>http://blog.humandoing.net/2008/03/29/sustainable-software-development/#comments</comments>
		<pubDate>Sat, 29 Mar 2008 09:29:00 +0000</pubDate>
		<dc:creator>Daniel Wintschel</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[thoughts]]></category>

		<guid isPermaLink="false">http://humandoing.net/past/2008/3/29/sustainable_software_development/</guid>
		<description><![CDATA[Avdi Grim has begun a thought-provoking series surrounding the idea of sustainable software development &#8211; specifically targeting Ruby as an example. With some of the recent discussion surrounding &#8220;monkey patching&#8221; in Ruby, I think that the timing seems about right, for some serious thought to be given about the long-term effects of maintaining Ruby-based code-bases, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://avdi.org">Avdi Grim</a> has <a href="http://avdi.org/devblog/2008/03/25/sustainable-development-in-ruby-introduction/">begun</a> a thought-provoking series surrounding the idea of sustainable software development &#8211; specifically targeting Ruby as an example.</p>
<p>With some of the recent <a href="http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/0438def1676f036f/e74b9c0a81d34b20">discussion</a> surrounding &#8220;monkey patching&#8221; in Ruby, I think that the timing seems about right, for some serious thought to be given about the long-term effects of maintaining Ruby-based code-bases, should prolific &#8220;monkey patching&#8221; continue to be used haphazardly by many of the libraries, plugins, gems and other code that makes (sometimes critical?) modifications to the underlying core language classes.</p>
<p>Nick Sieger has crafted a thoughtful <a href="http://blog.nicksieger.com/articles/2008/03/14/monkey-patching-is-part-of-the-diy-culture">response</a> to Avdi, which includes the quote:</p>
<blockquote><p>[Monkey patching is] still a basic part of the Ruby programming culture, like it or not.</p>
</blockquote>
<p>While Nick is totally correct, and Ruby <em>does</em> give you the power to shoot, maim and otherwise pillage and murder yourself in a bazillion different ways &#8211; that doesn&#8217;t take away the fact that it is still an incredibly powerful, elegant and syntactically beautiful programming language.</p>
<p>At the risk of sounding like a trite broken record (for the 485,000 time), I think that once again it boils down to using and choosing the right tools for the job. If the consequences of Ruby&#8217;s dynamism (among whatever other consequences) outweigh the positive benefits that a Ruby solution provides &#8211; then choose a different tool.</p>
<p>You can complain about the verbosity of a language like Java all you want (heck, I know I do at times), but I come back to Java sometimes after working with Ruby for a few months, and I&#8217;m all of a sudden thankful for strict, static typing, always knowing what I&#8217;m gonna get.</p>
<p>What continues to irk me are the folks who seem completely hell-bent that their way is the only One True Way&#226;&#8222;&#162;.</p>
<p>I was in a job interview the other day (company name shall be kept confidential) at a place that does extensive software development in many languages including Java, C, C++, Perl and <span class="caps">PHP</span> (at the very least). Near the end of the interview, we were discussing different languages, and I mentioned how sometimes I really enjoy the dynamic typing facet of Ruby, as opposed to the statically typed facet of Java. At this statement, one of the interviewers piped up to tell me that the fact that I enjoyed dynamic typing at times was &#8220;the most brain-dead thing&#8221; he&#8217;d ever heard anyone say.</p>
<p>It seems so strange to me, to be on the receiving end of an insult like that, coming from a company that performs extensive development in <span class="caps">PHP</span> (which is not only <em>dynamically</em> typed, but also <em>weakly</em> typed, as opposed to Ruby which is strictly typed).</p>
<p>At any rate, all of that comes to some sort of summary that everyone should already know by now:</p>
<ol>
<li>there is no silver bullet</li>
<li>think before you choose your tool/language/whatever</li>
<li>don&#8217;t hate the unknown simply because it&#8217;s unknown</li>
<li>don&#8217;t call someone brain-dead if they sometimes enjoy a programming language that is dynamically typed, it hurts their feelings</li>
<li>read <a href="http://avdi.org/devblog/2008/03/27/sustainable-development-in-ruby-part-1-good-old-fashioned-inheritance/">Avdi&#8217;s</a> series on sustainable development in Ruby.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.humandoing.net/2008/03/29/sustainable-software-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Inserts failing on Oracle with JRuby and activerecord-jdbc</title>
		<link>http://blog.humandoing.net/2008/02/22/inserts-failing-on-oracle-with-jruby-and-activerecord-jdbc/</link>
		<comments>http://blog.humandoing.net/2008/02/22/inserts-failing-on-oracle-with-jruby-and-activerecord-jdbc/#comments</comments>
		<pubDate>Fri, 22 Feb 2008 09:19:00 +0000</pubDate>
		<dc:creator>Daniel Wintschel</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jruby]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://humandoing.net/past/2008/2/22/inserts_failing_on_oracle_with/</guid>
		<description><![CDATA[A couple weeks ago I ran into some horrible issues with Oracle and activerecord-jdbc. Inserts were failing with an &#8220;invalid column index&#8221; error. It turns out this was reported as JRUBY-2018 and resolved, but there wasn&#8217;t a release of activerecord-jdbc that contained the fix. Being impatient like I am, I grabbed the head from svn [...]]]></description>
			<content:encoded><![CDATA[<p>A couple weeks ago I ran into some horrible issues with Oracle and activerecord-jdbc. Inserts were failing with an &#8220;invalid column index&#8221; error.</p>
<p>It turns out this was reported as <a href="http://jira.codehaus.org/browse/JRUBY-2018"><span class="caps">JRUBY</span>-2018</a> and resolved, but there wasn&#8217;t a release of activerecord-jdbc that contained the fix.</p>
<p>Being impatient like I am, I grabbed the head from svn and built it myself. So if you ever find you need to build yourself an activerecord-jdbc gem from subversion, here you go:</p>
<p>First make sure you have <code>hoe</code> installed.</p>
<pre><code>jruby -S gem install hoe<br/></code></pre>
<p>Grab the source from svn.</p>
<pre><code>svn co http://jruby-extras.rubyforge.org/svn/trunk/activerecord-jdbc<br/></code></pre>
<p>Build the <code>.gem</code></p>
<pre><code>jruby -S rake package</code></pre>
<p>Install the generated <code>.gem</code> file.</p>
<pre><code>jruby -S gem install activerecord-jdbc-adapter-[version].gem</code></pre>
<p><strong><span class="caps">MAKE SURE YOU UNINSTALL YOUR PREVIOUS VERSION</span></strong></p>
<p>The chances that you&#8217;ll have to do this are very slim. <a href="http://blog.nicksieger.com/">Nick Sieger</a> is usually super-on-top of making sure things are up and working the way they should be, but just in case.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.humandoing.net/2008/02/22/inserts-failing-on-oracle-with-jruby-and-activerecord-jdbc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mac OS X, MacPorts, ImageMagick and RMagick</title>
		<link>http://blog.humandoing.net/2007/09/05/mac-os-x-macports-imagemagick-and-rmagick/</link>
		<comments>http://blog.humandoing.net/2007/09/05/mac-os-x-macports-imagemagick-and-rmagick/#comments</comments>
		<pubDate>Thu, 06 Sep 2007 06:05:00 +0000</pubDate>
		<dc:creator>Daniel Wintschel</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[macosx]]></category>
		<category><![CDATA[rmagick]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://humandoing.net/past/2007/9/6/mac_os_x_macports_imagemagick/</guid>
		<description><![CDATA[In the process of setting up my new dev machine, I decided I was going to try using MacPorts to install all of the dev-type-software instead of installing into /usr/local. James Duncan Davidson has a great overview article (that needs no further explaining from myself), titled Sandboxing Rails With MacPorts. Another similar article can be [...]]]></description>
			<content:encoded><![CDATA[<p>In the process of setting up my new dev machine, I decided I was going to try using MacPorts to install all of the dev-type-software instead of installing into <code>/usr/local</code>.</p>
<p>James Duncan Davidson has a great overview article (that needs no further explaining from myself), titled <a href="http://duncandavidson.com/archives/164">Sandboxing Rails With MacPorts</a>. Another similar article can be found <a href="http://paulsturgess.co.uk/articles/show/46-using-macportsdarwinports-to-install-ruby-on-rails-mysql-subversion-capistrano-and-mongrel-on-mac-os-x">here</a>.</p>
<p>My problem is that I work on a lot of projects that use ImageMagick / RMagick, and that&#8217;s not discussed here.</p>
<p>No worries, I&#8217;ll install &#8216;em and give it a go:</p>
<pre><code>sudo port intall ImageMagick<br/>sudo gem install rmagick</code></pre>
<p><span class="caps">CRAP</span>! I don&#8217;t know what happens for you, but ImageMagick installs perfectly for me, and then RMagick craps out and dies something like this:</p>
<pre><code>/opt/local/lib/ruby/gems/1.8/gems/rmagick-1.15.9/./lib/rvg/misc.rb:321:in `get_type_metrics': <br/>unable to read font `(null)' (Magick::ImageMagickError)<br/> from /opt/local/lib/ruby/gems/1.8/gems/rmagick-1.15.9/./lib/rvg/misc.rb:321:in `render'<br/> from /opt/local/lib/ruby/gems/1.8/gems/rmagick-1.15.9/./lib/rvg/misc.rb:696:in `text'</code></pre>
<p>Now, for the solution I am going to give all credit to <a href="http://mentalized.net/about/">Jakob Skjerning</a>, because I found the solution on <a href="http://mentalized.net/journal/2007/08/05/os_x_macports_imagemagick_and_rmagick/">his site</a> after doing some Googling.</p>
<p>Do this instead:</p>
<pre><code>sudo port install ImageMagick<br/>sudo port install rb-rmagick</code></pre>
<p>Done. Works. Thank goodness.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.humandoing.net/2007/09/05/mac-os-x-macports-imagemagick-and-rmagick/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby on Rails and XML (a little late)</title>
		<link>http://blog.humandoing.net/2007/08/28/ruby-on-rails-and-xml-a-little-late/</link>
		<comments>http://blog.humandoing.net/2007/08/28/ruby-on-rails-and-xml-a-little-late/#comments</comments>
		<pubDate>Tue, 28 Aug 2007 21:06:00 +0000</pubDate>
		<dc:creator>Daniel Wintschel</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://humandoing.net/past/2007/8/29/ruby_on_rails_and_xml/</guid>
		<description><![CDATA[I wrote this article for IBM developerWorks a while back, but never ended up blogging about it. So at any rate, here it is: Ruby on Rails and XML &#8211; for better or for worse.]]></description>
			<content:encoded><![CDATA[<p>I wrote this article for <span class="caps">IBM</span> developerWorks a while back, but never ended up blogging about it. So at any rate, here it is: <a href="http://www.ibm.com/developerworks/edu/x-dw-x-rubyonrailsxml.html">Ruby on Rails and <span class="caps">XML</span></a> &#8211; for better or for worse.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.humandoing.net/2007/08/28/ruby-on-rails-and-xml-a-little-late/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
