<?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"
	>

<channel>
	<title>randomba</title>
	<atom:link href="http://randomba.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://randomba.org</link>
	<description>Programming, Ruby, Rails, and other random things.</description>
	<pubDate>Thu, 06 Nov 2008 22:15:55 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>Thinking Sphinx and named_scope</title>
		<link>http://randomba.org/2008/11/thinking-sphinx-and-named_scope/</link>
		<comments>http://randomba.org/2008/11/thinking-sphinx-and-named_scope/#comments</comments>
		<pubDate>Thu, 06 Nov 2008 22:15:55 +0000</pubDate>
		<dc:creator>Norman</dc:creator>
		
		<category><![CDATA[rails]]></category>

		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://randomba.org/?p=53</guid>
		<description><![CDATA[Thinking Sphinx is a fantastic plugin for Ruby on Rails that makes using Sphinx pretty much a point-and-drool experience.
But sometimes it may be tricky or inconvenient to perform some operations using Sphinx, and you want to mix in some regular SQL. Here&#8217;s a very easy way to combine Thinking Sphinx searches with named scope:


  [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://ts.freelancing-gods.com/" onclick="javascript:urchinTracker ('/outbound/article/ts.freelancing-gods.com');">Thinking Sphinx</a> is a fantastic plugin for Ruby on Rails that makes using <a href="http://www.sphinxsearch.com/" onclick="javascript:urchinTracker ('/outbound/article/www.sphinxsearch.com');">Sphinx</a> pretty much a point-and-drool experience.</p>
<p>But sometimes it may be tricky or inconvenient to perform some operations using Sphinx, and you want to mix in some regular SQL. Here&#8217;s a very easy way to combine Thinking Sphinx searches with named scope:</p>
<p><code></p>
<pre>
  named_scope :sphinx, lambda {|*args| {
    :conditions => { :id => search_for_ids(*args) }
  }}
</pre>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://randomba.org/2008/11/thinking-sphinx-and-named_scope/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Ordering ActiveRecord results by RAND or RANDOM with MySQL and SQLite adapters</title>
		<link>http://randomba.org/2008/10/ordering-activerecord-results-by-rand-or-random-with-mysql-and-sqlite-adapters/</link>
		<comments>http://randomba.org/2008/10/ordering-activerecord-results-by-rand-or-random-with-mysql-and-sqlite-adapters/#comments</comments>
		<pubDate>Wed, 15 Oct 2008 19:21:55 +0000</pubDate>
		<dc:creator>Norman</dc:creator>
		
		<category><![CDATA[code]]></category>

		<category><![CDATA[rails]]></category>

		<category><![CDATA[ruby]]></category>

		<category><![CDATA[ActiveRecord]]></category>

		<guid isPermaLink="false">http://randomba.org/?p=47</guid>
		<description><![CDATA[Ordering ActiveRecord result sets by RANDOM() with Sqlite3 can be very handy. For example, here&#8217;s a named scope that would order records randomly and limit the result set to 5 results:


named_scope :random_five, :order => "RANDOM()", :limit => 5


The only problem with this is, if you&#8217;re using SQLite for testing and local development, and MySQL for [...]]]></description>
			<content:encoded><![CDATA[<p>Ordering ActiveRecord result sets by RANDOM() with Sqlite3 can be very handy. For example, here&#8217;s a named scope that would order records randomly and limit the result set to 5 results:</p>
<p><code></p>
<pre>
named_scope :random_five, :order => "RANDOM()", :limit => 5
</pre>
<p></code></p>
<p>The only problem with this is, if you&#8217;re using SQLite for testing and local development, and MySQL for deployment, your code is going to break because MySQL does not use the same random syntax that SQLite does. You can&#8217;t entirely blame the frequently-standards-incompliant MySQL here though, because ordering by random isn&#8217;t a part of standard SQL and is added as a stored procedure or vendor extension in most RDBMS&#8217;s.</p>
<p>To solve this problem, I&#8217;ve created a small monkey-patch to Rails which allows you to use code like the following:</p>
<p><code></p>
<pre>
named_scope :random_five, :order => :random, :limit => 5
</pre>
<p></code></p>
<p>You can <a href="http://pastie.org/293260" onclick="javascript:urchinTracker ('/outbound/article/pastie.org');">access the code here</a>.</p>
<p>What do you think? If you find this useful, let me know and I&#8217;ll submit it as a patch to Rails.</p>
]]></content:encoded>
			<wfw:commentRss>http://randomba.org/2008/10/ordering-activerecord-results-by-rand-or-random-with-mysql-and-sqlite-adapters/feed/</wfw:commentRss>
		</item>
		<item>
		<title>RESTful edit_in_place for Rails using JSON and some very fugly code</title>
		<link>http://randomba.org/2008/08/restful-edit_in_place-for-rails-using-json-and-some-very-fugly-code/</link>
		<comments>http://randomba.org/2008/08/restful-edit_in_place-for-rails-using-json-and-some-very-fugly-code/#comments</comments>
		<pubDate>Thu, 07 Aug 2008 21:08:28 +0000</pubDate>
		<dc:creator>Norman</dc:creator>
		
		<category><![CDATA[code]]></category>

		<category><![CDATA[rails]]></category>

		<category><![CDATA[ruby]]></category>

		<category><![CDATA[AJAX]]></category>

		<guid isPermaLink="false">http://randomba.org/?p=41</guid>
		<description><![CDATA[
A pastie is worth a thousand words:


http://pastie.org/249500


It&#8217;s not pretty, but lets you create a simple in place editor that works with RESTful controllers. Ideally, this should be done unobtrusively, but if you need to pass in a lot of options (for example, to change language used in the controls), then doing this unobtrusive can become [...]]]></description>
			<content:encoded><![CDATA[<p>
A pastie is worth a thousand words:
</p>
<p>
<a href="http://pastie.org/249500" onclick="javascript:urchinTracker ('/outbound/article/pastie.org');">http://pastie.org/249500</a>
</p>
<p>
It&#8217;s not pretty, but lets you create a simple in place editor that works with RESTful controllers. Ideally, this should be done unobtrusively, but if you need to pass in a lot of options (for example, to change language used in the controls), then doing this unobtrusive can become a bit of a PITA.
</p>
<p>
The only &#8220;weird&#8221; thing you need to do is make your show method have a block that responds to requests for JSON if you want to use the loadTextURL option.
</p>
<p>
I&#8217;ll see about doing this up as a simple plugin if anyone is interested.
</p>
<p>
If you want to see a nice rails plugin that does some of this in a more unobtrusive manner, check out Pat Nakajima&#8217;s <a href="http://github.com/nakajima/better-edit-in-place/tree" onclick="javascript:urchinTracker ('/outbound/article/github.com');">better_edit_in_place</a> plugin. It&#8217;s still being actively developed but looks like it will soon be an excellent resource.</p>
]]></content:encoded>
			<wfw:commentRss>http://randomba.org/2008/08/restful-edit_in_place-for-rails-using-json-and-some-very-fugly-code/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Announcing has_image - A lightweight, hackable image attachment plugin for Rails</title>
		<link>http://randomba.org/2008/07/announcing-has_image-a-lightweight-hackable-image-attachment-plugin-for-rails/</link>
		<comments>http://randomba.org/2008/07/announcing-has_image-a-lightweight-hackable-image-attachment-plugin-for-rails/#comments</comments>
		<pubDate>Fri, 25 Jul 2008 13:42:50 +0000</pubDate>
		<dc:creator>Norman</dc:creator>
		
		<category><![CDATA[code]]></category>

		<category><![CDATA[has_image]]></category>

		<category><![CDATA[plugins]]></category>

		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://randomba.org/?p=31</guid>
		<description><![CDATA[HasImage is a plugin/gem that allows Ruby on Rails applications to have attached images. It is very small and lightweight: it only requires one column (&#8221;has_image_file&#8221;) in your model to store the uploaded image&#8217;s file name.
It is, by design, very simplistic: It only supports using a filesystem for storage, and only supports MiniMagick as an [...]]]></description>
			<content:encoded><![CDATA[<p>HasImage is a plugin/gem that allows Ruby on Rails applications to have attached images. It is very small and lightweight: it only requires one column (&#8221;has_image_file&#8221;) in your model to store the uploaded image&#8217;s file name.</p>
<p>It is, by design, very simplistic: It only supports using a filesystem for storage, and only supports MiniMagick as an image processor. However, its code is very small, clean and hackable, so adding support for other backends or processors should be fairly easy.</p>
<p>HasImage works best for sites that want to show image galleries with fixed-size thumbnails. It uses ImageMagick&#8217;s crop and center gravity functions to produce thumbnails that generally look acceptable, unless the image is a panorama, or the subject matter is close to one of the margins, etc. For most sites where people upload pictures of themselves or their pets the generated thumbnails will look good almost all the time.</p>
<p>It&#8217;s pretty easy to change the image processing / resizing code; you can just override HasImage::Processor#resize_image to do what you wish:</p>
<p> <code>
<pre>
  module HasImage::
    class Processor
      def resize_image(size)
        @image.combine_options do |commands|
          commands.my_custom_resizing_goes_here
        end
      end
    end
  end
</pre>
<p></code></p>
<h3>Another image attachment library? Why?</h3>
<p><em>The three chief virtues of a programmer are: Laziness, Impatience and Hubris.</em> - Larry Wall</p>
<p>Attachment_fu is too large and general for some of the places I want to use images. I sometimes found myself writing more code to hack attachment_fu than it took to create this gem. In fact, most of the code here has been plucked from my various projects that use attachment_fu.</p>
<p>The other image attachment libraries I found fell short of my needs for various other reasons, so I decided to roll my own.</p>
<h3>Examples</h3>
<h4>Point-and-drool use case:</h4>
<p>It&#8217;s probably not what you want, but it may be useful for bootstrapping.</p>
<p><code>
<pre>
  class Member < ActiveRecord::Base
    has_image
  end
</pre>
<p></code></p>
<h4>Single image, no thumbnails, with some size limits:</h4>
<p><code>
<pre>
  class Picture < ActiveRecord::Base
    has_image :resize_to => "200x200",
      :max_size => 3.megabytes,
      :min_size => 4.kilobytes
  end
</pre>
<p></code></p>
<h4>Image with some thumbnails:</h4>
<p><code>
<pre>
  class Photo < ActiveRecord::Base
    has_image :resize_to => "640x480",
      :thumbnails => {
        :square => "200x200",
        :medium => "320x240"
      },
      :max_size => 3.megabytes,
      :min_size => 4.kilobytes
  end
</pre>
<p></code></p>
<p>HasImage also provides a view helper to make displaying the images extremely simple:</p>
<p>  &lt;%= image_tag_for(@photo, :thumb => :square) %&gt;</p>
<h3>Getting it</h3>
<p>Has image can be installed as a gem, or as a Rails plugin. Gem installation is easiest, and recommended:</p>
<p>  gem install has_image</p>
<p>and add</p>
<p>  require &#8216;has_image&#8217;</p>
<p>to your environment.rb file.</p>
<p>Alternatively, you can install it as a Rails plugin:</p>
<p>  ./script plugin install git://github.com/norman/has_image.git</p>
<p>Rails versions before 2.1 do not support plugin installation using Git, so if you&#8217;re on 2.0 (or earlier), then please install the gem rather than the plugin.</p>
<p>Then, make sure the model has a column named &#8220;has_image_file.&#8221;</p>
<h3>Git repository:</h3>
<p>  git://github.com/norman/has_image.git</p>
<h3>Hacking it</h3>
<p>Don&#8217;t like the way it makes images? Want to pipe the images through <a href="http://eigenclass.org/hiki/seam-carving-in-ocaml" onclick="javascript:urchinTracker ('/outbound/article/eigenclass.org');">some crazy fast seam carving library written in OCaml</a>, or watermark them with your corporate logo? Happiness is just a <a href="http://en.wikipedia.org/wiki/Monkey_patch" onclick="javascript:urchinTracker ('/outbound/article/en.wikipedia.org');">monkey-patch</a> away:</p>
<p><code>
<pre>
  module HasImage
    class Processor
      def resize_image(size)
        # your new-and-improved thumbnailer code goes here.
      end
    end
  end
</pre>
<p></code></p>
<p>HasImage follows a philosophy of &#8220;<a href="http://weblog.jamisbuck.org/2006/10/18/skinny-controller-fat-model" onclick="javascript:urchinTracker ('/outbound/article/weblog.jamisbuck.org');">skinny model, fat plugin</a>.&#8221; This means that it tries to pollute your ActiveRecord model with as little functionality as possible, so that in a sense, the model is acts like a &#8220;controller&#8221; and the plugin like a &#8220;model&#8221; as regards the image handling functionality. This makes it easier to test, hack, and reuse, because the storage and processing functionality is largely independent of your model, and of Rails.</p>
<p>My goal for HasImage is to keep it very small. If you need <strong>a lot</strong> of functionality that&#8217;s not here, instead of patching this code, you will likely be better off using attachment_fu, which is much more powerful, but also more complex.</p>
<h3>Bugs</h3>
<p>Please report them on <a href="http://randomba.lighthouseapp.com/projects/14674-has_image" onclick="javascript:urchinTracker ('/outbound/article/randomba.lighthouseapp.com');">Lighthouse</a>.</p>
<p>At the time of writing (July 2008), HasImage is in its infancy. Your patches, bug reports and withering criticism are more than welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://randomba.org/2008/07/announcing-has_image-a-lightweight-hackable-image-attachment-plugin-for-rails/feed/</wfw:commentRss>
		</item>
		<item>
		<title>friendly_id works with Rails 2.1</title>
		<link>http://randomba.org/2008/05/friendly_id-works-with-rails-21/</link>
		<comments>http://randomba.org/2008/05/friendly_id-works-with-rails-21/#comments</comments>
		<pubDate>Mon, 12 May 2008 23:17:36 +0000</pubDate>
		<dc:creator>Norman</dc:creator>
		
		<category><![CDATA[friendly_id]]></category>

		<category><![CDATA[plugins]]></category>

		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://randomba.org/index.php/2008/05/12/friendly_id-works-with-rails-21/</guid>
		<description><![CDATA[With the first release candidate of Rails 2.1 now out, I&#8217;ve tested friendly_id against it today. Yeah, I&#8217;m not really a big &#8220;edge&#8221; guy. In case anyone was worried, it appears to work fine. Let me know if you discover otherwise.
]]></description>
			<content:encoded><![CDATA[<p>With the first release candidate of <a href="http://twitter.com/d2h/statuses/808936705" onclick="javascript:urchinTracker ('/outbound/article/twitter.com');">Rails 2.1 now out</a>, I&#8217;ve tested <a href="http://github.com/norman/friendly_id/tree/master" onclick="javascript:urchinTracker ('/outbound/article/github.com');">friendly_id</a> against it today. Yeah, I&#8217;m not really a big &#8220;edge&#8221; guy. In case anyone was worried, it appears to work fine. Let me know if you discover otherwise.</p>
]]></content:encoded>
			<wfw:commentRss>http://randomba.org/2008/05/friendly_id-works-with-rails-21/feed/</wfw:commentRss>
		</item>
		<item>
		<title>friendly_id moving to Github</title>
		<link>http://randomba.org/2008/04/friendly_id-moving-to-github/</link>
		<comments>http://randomba.org/2008/04/friendly_id-moving-to-github/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 13:35:59 +0000</pubDate>
		<dc:creator>Norman</dc:creator>
		
		<category><![CDATA[friendly_id]]></category>

		<category><![CDATA[plugins]]></category>

		<category><![CDATA[rails]]></category>

		<category><![CDATA[ruby]]></category>

		<category><![CDATA[git]]></category>

		<category><![CDATA[github]]></category>

		<guid isPermaLink="false">http://randomba.org/index.php/2008/04/18/friendly_id-moving-to-github/</guid>
		<description><![CDATA[I&#8217;ve been working with Git for the last few weeks and have decided to move friendly_id over to Github. The svn repository will remain live for at least a month of so after Rails 2.1 is released, since the support for git-hosted plugins is currently only available in Edge Rails.
For now, all development is being [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working with Git for the last few weeks and have decided to <a href="http://github.com/norman/friendly_id/tree/master" onclick="javascript:urchinTracker ('/outbound/article/github.com');">move friendly_id over to Github</a>. The svn repository will remain live for at least a month of so after Rails 2.1 is released, since the support for git-hosted plugins is currently only available in Edge Rails.</p>
<p>For now, all development is being committed to Git, and then patched into the svn repository. So, if you&#8217;re using the svn repository don&#8217;t worry, it will remain current for a while.</p>
<p>I remember first hearing about Git during the Linux/Bitkeeper contoversy, and recall thinking Linus Torvalds was odd for not using CVS or Subversion over Bitkeeper, and then thinking he was certifiably insane for deciding to roll his own version tracking system once Bitkeeper didn&#8217;t work out.</p>
<p>Of course, Linus Torvalds is (a) a better programmer than me and (b) smarter than me, so there you go. Git has evolved into a very nice tracking system; for me everything that was slow and annoying in SVN (namely, comparing revisions and branching) is fast and easy using Git. If you haven&#8217;t yet taken a look at it, you should.</p>
<p>You can take a peek at the shiny new friendly_id repository <a href="http://github.com/norman/friendly_id/tree/master" onclick="javascript:urchinTracker ('/outbound/article/github.com');">here</a>.</p>
<p>If you&#8217;d like to see a quick introduction to Git, take a peek at Sebastian Delmont&#8217;s presentation below.</p>
<p><object type="application/x-shockwave-flash" width="400" height="291" data="http://www.vimeo.com/moogaloop.swf?clip_id=777977&amp;server=www.vimeo.com&amp;fullscreen=1&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color="><param name="quality" value="best" /><param name="allowfullscreen" value="true" /><param name="scale" value="showAll" /><param name="movie" value="http://www.vimeo.com/moogaloop.swf?clip_id=777977&amp;server=www.vimeo.com&amp;fullscreen=1&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=" /></object><br /><a href="http://www.vimeo.com/777977/l:embed_777977" onclick="javascript:urchinTracker ('/outbound/article/www.vimeo.com');">GIT Talk (nyc.rb)</a> from <a href="http://www.vimeo.com/user371744/l:embed_777977" onclick="javascript:urchinTracker ('/outbound/article/www.vimeo.com');">Sebastian Delmont</a> on <a href="http://vimeo.com/l:embed_777977" onclick="javascript:urchinTracker ('/outbound/article/vimeo.com');">Vimeo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://randomba.org/2008/04/friendly_id-moving-to-github/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to test flash.now in Rails</title>
		<link>http://randomba.org/2008/04/how-to-test-flashnow-in-rails/</link>
		<comments>http://randomba.org/2008/04/how-to-test-flashnow-in-rails/#comments</comments>
		<pubDate>Thu, 17 Apr 2008 15:38:48 +0000</pubDate>
		<dc:creator>Norman</dc:creator>
		
		<category><![CDATA[code]]></category>

		<category><![CDATA[rails]]></category>

		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://randomba.org/index.php/2008/04/17/how-to-test-flashnow-in-rails/</guid>
		<description><![CDATA[I got stuck for a few minutes trying to figure out how to write a unit test to check if a value was being set in the flash using flash.now. In Rails&#8217; Test::Unit you can&#8217;t just do something like assert_not_nil flash[:notice] because the flash value is discarded at the end of the request, and so [...]]]></description>
			<content:encoded><![CDATA[<p>I got stuck for a few minutes trying to figure out how to write a unit test to check if a value was being set in the flash using flash.now. In Rails&#8217; Test::Unit you can&#8217;t just do something like assert_not_nil flash[:notice] because the flash value is discarded at the end of the request, and so the flash is always nil.</p>
<p>The solution is to use Mocha to mock an instance of ActionController::Flash::FlashHash and capture the value being set. Here was my solution:</p>
<p><code></p>
<pre>
def test_create_with_empty_email_sets_error_in_flash
  hash = {}
  ActionController::Flash::FlashHash.any_instance.expects(:now).returns(
    hash
  )
  post :create
  assert_not_nil hash[:error]
end
</pre>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://randomba.org/2008/04/how-to-test-flashnow-in-rails/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Getting Postfix to use SASL on Debian Etch</title>
		<link>http://randomba.org/2008/04/getting-postfix-to-use-sasl-on-debian-etch/</link>
		<comments>http://randomba.org/2008/04/getting-postfix-to-use-sasl-on-debian-etch/#comments</comments>
		<pubDate>Thu, 10 Apr 2008 21:40:59 +0000</pubDate>
		<dc:creator>Norman</dc:creator>
		
		<category><![CDATA[debian]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://randomba.org/index.php/2008/04/10/getting-postfix-to-use-sasl-on-debian-etch/</guid>
		<description><![CDATA[I have been tripping over this for days and finally, though the miracle of this thing called Google, found a mailing list post describing exactly how to do it. Here it is, relinked so that others may find it.
Don&#8217;t you ever feel really dumb when you realize that what you&#8217;ve been trying to do for [...]]]></description>
			<content:encoded><![CDATA[<p>I have been tripping over this for days and finally, though the miracle of this thing called Google, found a mailing list post describing exactly how to do it. <a href="http://www.irbs.net/internet/postfix/0705/1301.html" onclick="javascript:urchinTracker ('/outbound/article/www.irbs.net');">Here it is</a>, relinked so that others may find it.</p>
<p>Don&#8217;t you ever feel really dumb when you realize that what you&#8217;ve been trying to do for days is actually so easy? I haven&#8217;t worked as a sysadmin for 4 years now and find my skills have really atrophied&#8230; but anyway&#8230; thanks to the Google gods I have managed once more to get away with it.</p>
]]></content:encoded>
			<wfw:commentRss>http://randomba.org/2008/04/getting-postfix-to-use-sasl-on-debian-etch/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Moved blog to WordPress</title>
		<link>http://randomba.org/2008/02/moved-blog-to-wordpress/</link>
		<comments>http://randomba.org/2008/02/moved-blog-to-wordpress/#comments</comments>
		<pubDate>Thu, 07 Feb 2008 15:02:56 +0000</pubDate>
		<dc:creator>Norman</dc:creator>
		
		<category><![CDATA[randomba]]></category>

		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.randomba.org/index.php/2008/02/07/moved-blog-to-wordpress/</guid>
		<description><![CDATA[
I decided to move the blog over to WordPress rather than Typo. I really wanted to like Typo, because I like Rails. But the fact of the matter is that WordPress is just much better software and so I decided to move things over to it.


Just because Rails is good is not an excuse to [...]]]></description>
			<content:encoded><![CDATA[<p>
I decided to move the blog over to WordPress rather than Typo. I really <span style="font-weight: bold" class="Apple-style-span">wanted</span> to like Typo, because I like Rails. But the fact of the matter is that WordPress is just much better software and so I decided to move things over to it.
</p>
<p>
Just because Rails is good is not an excuse to avoid using quality software written in another programming language. I know a lot of Rails developers dislike PHP but I&#8217;m happy to work with good software - especially free software - no matter what language it&#8217;s written our in. And this blog was never meant to be a &#8220;Rails blog,&#8221; we here at Randomba also work with C++, Java, PHP, Perl, Objective C, Cocoa and a lot of other languages/frameworks. Yes, we CAN all get along. <img src='http://randomba.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> We just happen to be doing a lot of Rails stuff lately.
</p>
<p>
Anyway&#8230; this means that I need to apologize to the <span style="text-decoration: line-through; -webkit-text-decorations-in-effect: line-through" class="Apple-style-span">thousands</span> <span style="text-decoration: line-through; -webkit-text-decorations-in-effect: line-through" class="Apple-style-span">hundreds</span> several people that left comments on the previous blog; it was a little complicated to port them over, and I got lazy and decided to leave them. This should be the last time it happens, I promise.</p>
]]></content:encoded>
			<wfw:commentRss>http://randomba.org/2008/02/moved-blog-to-wordpress/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Installing Ruby 1.8.6 on Debian Etch (stable)</title>
		<link>http://randomba.org/2008/01/installing-ruby-186-on-debian-etch-stable/</link>
		<comments>http://randomba.org/2008/01/installing-ruby-186-on-debian-etch-stable/#comments</comments>
		<pubDate>Wed, 30 Jan 2008 02:06:00 +0000</pubDate>
		<dc:creator>Norman</dc:creator>
		
		<category><![CDATA[debian]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[ruby]]></category>

		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://randomba.com/?p=22</guid>
		<description><![CDATA[I recently had to set up Ruby 1.8.6 on a server running Debian Etch stable. Debian is famous for its slow release cycle - Debian stable often lags far behind other Linux releases in terms of software package versions, though it provides an amazingly comprehensive set of well-tested packages and great stability, making it a [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had to set up Ruby 1.8.6 on a server running Debian Etch stable. Debian is famous for its slow release cycle - Debian stable often lags far behind other Linux releases in terms of software package versions, though it provides an amazingly comprehensive set of well-tested packages and great stability, making it a great choice as a server platform.</p>
<p>However the current release, Etch, comes with Ruby 1.8.5, which is a bit old and has some problems running Mongrel. It&#8217;s very easy to download and compile Ruby, installing it in /usr/local, but this bypasses Debian&#8217;s packaging system. But it&#8217;s easy to do better; using Ruby&#8217;s package manager to install Ruby and maintaining all the benefits of having your installed software under package management.</p>
<p>Note that you&#8217;ll need to be root to run these commands.</p>
<p>
<strong>Make sure you haven&#8217;t installed ruby in your package manager yet.</strong>
</p>
<p>
Or, if you have, uninstall it before proceeding to avoid package conflicts. Read the comments on the post below for more details.
</p>
<p>1) Update your /etc/apt/sources.list, to use Debian&#8217;s &#8220;unstable&#8221; source packages:</p>
<p>deb-src ftp://debian.mirrors.tds.net/debian/ unstable main non-free contrib</p>
<p>2) Update your list of available packages:</p>
<p>apt-get update</p>
<p>3) Install Ruby&#8217;s build dependencies:</p>
<p>apt-get build-dep ruby1.8</p>
<p>4) Install Debian&#8217;s package management development programs:</p>
<p>apt-get install dpkg-dev</p>
<p>5) Download the Ruby source package and build it:</p>
<p>apt-get source -b ruby1.8</p>
<p>This took about 5 minutes on my system with SATA disks and a 2 gig P4. It creates the following packages:</p>
<ul>
<li>irb1.8<em>1.8.6.111-4</em>all.deb</li>
<li>libdbm-ruby1.8<em>1.8.6.111-4</em>i386.deb</li>
<li>libgdbm-ruby1.8<em>1.8.6.111-4</em>i386.deb</li>
<li>libopenssl-ruby1.8<em>1.8.6.111-4</em>i386.deb</li>
<li>libreadline-ruby1.8<em>1.8.6.111-4</em>i386.deb</li>
<li>libruby1.8<em>1.8.6.111-4</em>i386.deb</li>
<li>libruby1.8-dbg<em>1.8.6.111-4</em>i386.deb</li>
<li>libtcltk-ruby1.8<em>1.8.6.111-4</em>i386.deb</li>
<li>rdoc1.8<em>1.8.6.111-4</em>all.deb</li>
<li>ri1.8<em>1.8.6.111-4</em>all.deb</li>
<li>ruby1.8<em>1.8.6.111-4</em>i386.deb</li>
<li>ruby1.8-dev<em>1.8.6.111-4</em>i386.deb</li>
<li>ruby1.8-elisp<em>1.8.6.111-4</em>all.deb</li>
<li>ruby1.8-examples<em>1.8.6.111-4</em>all.deb</li>
</ul>
<p>6) Install the packages:</p>
<p>dpkg -i *.deb</p>
<p>You can also just install the ones you think you&#8217;ll need; at very least you&#8217;ll want ruby1.8<em>1.8.6.111-4</em>i386.deb, and the ri, rdoc and irb packages.</p>
<p>7) Bask in the Ruby 1.8.6 goodness:</p>
<p>norman@randomba:$ ruby -v</p>
<p>ruby 1.8.6 (2007-09-24 patchlevel 111) [i486-linux]</p>
]]></content:encoded>
			<wfw:commentRss>http://randomba.org/2008/01/installing-ruby-186-on-debian-etch-stable/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
