<?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/"
	xmlns:series="http://unfoldingneurons.com/"
	>

<channel>
	<title>MettaProgramming &#187; gems</title>
	<atom:link href="http://mettadore.com/tag/gems/feed/" rel="self" type="application/rss+xml" />
	<link>http://mettadore.com</link>
	<description>Thoughts on Software and Technology</description>
	<lastBuildDate>Mon, 09 Apr 2012 19:11:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Quick, &#8220;random records&#8221; module</title>
		<link>http://mettadore.com/ruby/quick-random-records-module/</link>
		<comments>http://mettadore.com/ruby/quick-random-records-module/#comments</comments>
		<pubDate>Wed, 23 Jun 2010 23:46:10 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[ActiveRecord]]></category>
		<category><![CDATA[gems]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[ungems]]></category>

		<guid isPermaLink="false">http://mettadore.com/?p=420</guid>
		<description><![CDATA[There are plenty of times when I want to grab either one or many random records from a database in Rails. For instance, one random user, one random post, 5 random items, etc. Honestly, it&#8217;s one of those things I do in nearly every app I&#8217;ve written, so a while ago I created a module [...]]]></description>
			<content:encoded><![CDATA[<p>There are plenty of times when I want to grab either one or many random records from a database in Rails. For instance, one random user, one random post, 5 random items, etc. Honestly, it&#8217;s one of those things I do in nearly every app I&#8217;ve written, so a while ago I created a module to add to any ActiveRecord class that gave me one() and some() methods. This way, I can just include Randomizer and have the methods. Everyone probably already has their method&#8211; I actually got this from somewhere else and modified it a bit&#8211; I figured I&#8217;d post mine in case someones searching the innerwebs.<sup><a href="http://mettadore.com/ruby/quick-random-records-module/#footnote_0_420" id="identifier_0_420" class="footnote-link footnote-identifier-link" title="It&amp;#8217;s one of those things that could be in a plugin or gem, but I&amp;#8217;m getting really sick of gems and plugins that carry all the infrastructure to support being gems or plugins when they are really simply a wee bit of code in one small file. Thus, I&amp;#8217;m starting to just publish Gists and add them manually to my lib directory. They&amp;#8217;re not really gems&amp;#8211; they&amp;#8217;re more like ungems. Maybe shards.">1</a></sup></p>
<p>[gist id=450723] </p>
<ol class="footnotes"><li id="footnote_0_420" class="footnote">It&#8217;s one of those things that could be in a plugin or gem, but I&#8217;m getting really sick of gems and plugins that carry all the infrastructure to support being gems or plugins when they are really simply a wee bit of code in one small file. Thus, I&#8217;m starting to just publish Gists and add them manually to my lib directory. They&#8217;re not really gems&#8211; they&#8217;re more like ungems. Maybe shards.</li></ol>]]></content:encoded>
			<wfw:commentRss>http://mettadore.com/ruby/quick-random-records-module/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby Gems and Snow Leopard</title>
		<link>http://mettadore.com/ruby/ruby-gems-and-snow-leopard/</link>
		<comments>http://mettadore.com/ruby/ruby-gems-and-snow-leopard/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 19:29:42 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[gems]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://mettadore.com/?p=145</guid>
		<description><![CDATA[I&#8217;ve been getting really grumpy lately because strange things keep happening when I try to build Ruby apps&#8211; specifically on Rails. It turns out that some of my problems weren&#8217;t due to my horrible lack of competence, but instead to the fact that the Ruby installation on Snow Leopard (installed from Xtools) had some weird [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been getting really grumpy lately because strange things keep happening when I try to build Ruby apps&#8211; specifically on Rails. It turns out that some of my problems weren&#8217;t due to my horrible lack of competence, but instead to the fact that the Ruby installation on Snow Leopard (installed from Xtools) had some weird things going on with regards to Gems. I thought I&#8217;d throw it up here because I tend to have problems more than once, and my blogs are as much a <a href="http://harrypotter.wikia.com/wiki/Pensieve">pensieve</a> as they are anything.</p>
<p>So, the default installation of Ruby on Snow Leopard holds a set of default gems in</p>
<pre class="brush: bash; title: ; notranslate">

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
</pre>
<p>That&#8217;s nice, because the system comes set up for basically instant development. However, those gems are out of date, and I kept having problems installing newer versions and get gem collisions. The main source of the problem was that I couldn&#8217;t simply &#8220;<span style="font-family: terminal,monaco">gem uninstall [old-version]</span>&#8221; because the versions in the default directory stuck around. Similarly &#8220;<span style="font-family: terminal,monaco">gem clean</span>&#8221; wouldn&#8217;t really vacuum anything up.</p>
<p>My solution was simply to remove them.</p>
<pre class="brush: bash; title: ; notranslate">

sudo mv /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8.default

sudo mkdir /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
</pre>
<p>After this, I also removed all the user gems in /Library/Ruby/Gems/1.8, just to make sure nothing was around and cleaned things up until &#8220;<span style="font-family: terminal,monaco">gem list</span>&#8221; showed nothing. After that, I reinstalled all the gems I needed and ran &#8220;<span style="font-family: terminal,monaco">gem update &#8211;system</span>&#8221;</p>
<p>Now there won&#8217;t be any clash with the default gems that were installed with Snow Leopard, and I can still get to them if, for some strange reason, I need them.</p>
]]></content:encoded>
			<wfw:commentRss>http://mettadore.com/ruby/ruby-gems-and-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

