<?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>tail -f findings.out &#187; RubyOnRails</title>
	<atom:link href="http://dancingpenguinsoflight.com/category/programming/rubyonrails/feed/" rel="self" type="application/rss+xml" />
	<link>http://dancingpenguinsoflight.com</link>
	<description></description>
	<lastBuildDate>Sun, 21 Aug 2011 14:33:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>git tip: Ignoring modifications to tracked files</title>
		<link>http://dancingpenguinsoflight.com/2010/02/git-tip-ignoring-modifications-to-tracked-files/</link>
		<comments>http://dancingpenguinsoflight.com/2010/02/git-tip-ignoring-modifications-to-tracked-files/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 04:13:29 +0000</pubDate>
		<dc:creator>Samuel Huckins</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[RubyOnRails]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[VCS]]></category>

		<guid isPermaLink="false">http://dancingpenguinsoflight.com/?p=1427</guid>
		<description><![CDATA[Problem You have a file already tracked in your git repository, but you don&#8217;t want future modifications to it to be tracked. A perfect example of this is the DB config file for Rails projects (config/database.yml). You&#8217;ll probably want to &#8230; <a href="http://dancingpenguinsoflight.com/2010/02/git-tip-ignoring-modifications-to-tracked-files/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h2>Problem</h2>
<p><em>You have a file already tracked in your git repository, but you don&#8217;t want future modifications to it to be tracked.</em></p>
<p>A perfect example of this is the DB config file for Rails projects (config/database.yml). You&#8217;ll probably want to track this to keep the production and staging configuration stored and consistent. But it&#8217;s quite likely that individual development configurations will be different. Having a commit for each developer adding their own local configuration and thereby polluting it for others when they push is just silly.</p>
<h2>Solution</h2>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">git update-index</span> <span style="color: #660033;">--assume-unchanged</span> FILENAME</div></td></tr></tbody></table></div>
<h2>The fun details</h2>
<p>I had initially thought that <a title="git-ignore docs" href="http://ftp.cc.uoc.gr/pub/software/scm/git/docs/gitignore.html" target="_blank">git-ignore</a> was the thing to use for this. That was wrong: git-ignore&#8217;s purpose is to allow ignoring of <em>untracked</em> files. In the case of the Rails DB conf example above, the file is already tracked. It has the instance information that needs to be shared and now we want to add local development details. Since it&#8217;s tracked, any modifications are going to be picked up by <a title="git-status docs" href="http://www.kernel.org/pub/software/scm/git/docs/git-status.html" target="_blank">git-status</a>. When you do a commit including changes to tracked files listed in .gitignore, the changes do indeed get pushed, which isn&#8217;t what we want.</p>
<p>When looking around for solutions to this, I saw &#8220;git rm &#8211;cached FILENAME&#8221; suggested as a way to stop tracking currently tracked files. And it does this, but it also deletes the file in the commit, which isn&#8217;t what we want either.</p>
<p><a title="git update-index man page" href="http://kernel.org/pub/software/scm/git/docs/v1.0.13/git-update-index.html">git update-index</a> allows you to alter your <a title="Post on git's staging area" href="http://www.gitready.com/beginner/2009/01/18/the-staging-area.html" target="_blank">staging area</a> more manually than usual. With it you can perform a wide range of operations not otherwise possible through standard commands. Continuing with the Rails DB conf example, here&#8217;s what the workflow would look like:</p>
<ol>
<li>config/database.yml with permanent instance info is added, committed, and pushed</li>
<li>Application code is pulled down by new developer</li>
<li>Local modifications made to database.yml for new developer&#8217;s local DB setup</li>
<li>git update-index &#8211;assume-unchanged config/database.yml</li>
</ol>
<p>Thereafter, the changes to conf/database.yml won&#8217;t appear in status or get committed. You can continue making and committing other changes, going about business as usual. But any changes to config/database.yml won&#8217;t ever appear.</p>
<p>In case you decide you <em>do</em> want to start tracking changes on a file previously ignored, just run:</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">git update-index</span> <span style="color: #660033;">--no-assume-unchanged</span> FILENAME</div></td></tr></tbody></table></div>
<p>Thereafter changes to FILENAME will appear in git-status.</p>
<h2>Gotcha</h2>
<p>The annoying part about this solution is that it has to be run against every new checkout of the repo with the files whose modifications should not be tracked. The command sets a particular bit per checkout, and it&#8217;s not passed on to new checkouts.</p>
<p>Just as I was finishing up some fact checking for this write-up, I came across <a href="http://justaddwater.dk/2009/12/07/how-to-make-git-ignore-files-that-already-exist-in-your-project/" target="_blank">Jesper Rønn-Jensen&#8217;s post</a> on this exact topic. If only it had come up in my initial searches! Here&#8217;s hoping the next searcher has better luck.</p>
    ]]></content:encoded>
			<wfw:commentRss>http://dancingpenguinsoflight.com/2010/02/git-tip-ignoring-modifications-to-tracked-files/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Rails on Ubuntu</title>
		<link>http://dancingpenguinsoflight.com/2009/05/rails-on-ubuntu/</link>
		<comments>http://dancingpenguinsoflight.com/2009/05/rails-on-ubuntu/#comments</comments>
		<pubDate>Mon, 18 May 2009 00:35:12 +0000</pubDate>
		<dc:creator>Samuel Huckins</dc:creator>
				<category><![CDATA[RubyOnRails]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://dancingpenguinsoflight.com/?p=961</guid>
		<description><![CDATA[[EDIT, 2009-12-20]: For some time I steered away from installing Rails via APT on Ubuntu systems. I ran into a number of annoyances early on trying to get various bits of Ruby, Rails, libraries, and others installed and working together &#8230; <a href="http://dancingpenguinsoflight.com/2009/05/rails-on-ubuntu/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong><em>[EDIT, 2009-12-20]:</em></strong> For some time I steered away from installing Rails via APT on Ubuntu systems. I ran into a number of annoyances early on trying to get various bits of Ruby, Rails, libraries, and others installed and working together properly. And along the way I just never tested the following on a fresh Ubuntu system:</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get install</span> rails sqlite3</div></td></tr></tbody></table></div>
<p>That&#8217;s it. On a freshly baked Ubuntu 9.10 Desktop or Server, this will install (as of today):</p>
<ul>
<li>ruby: 1.8.7</li>
<li>rails: 2.2.3</li>
<li>irb: 0.9.5</li>
<li>rake: 0.8.4</li>
<li>rdoc: 1.0.1</li>
<li>sqlite: 3.6.16</li>
<li>rubygems: 1.3.5</li>
</ul>
<p>And a host of dependencies of course. Perhaps I had simply FUBAR&#8217;ed my system by the time I tried this in the past, but it is working swimmingly now. Most of the other tutorials I&#8217;ve come across for Rails on Ubuntu take the more manual approach as well, but for now this looks like the way to go. For comparison, when I went through the more stepwise setup process using the script mentioned in the original content of this post below all the same versions were installed except for Rails itself, which was 2.3.5. So a slightly newer Rails version via gem than the Ubuntu repo, otherwise identical.</p>
<p>What follows is the original, more manual approach to getting everything installed. It might be useful to try if you run into problems with the repo package.</p>
<hr />
<p>As I tried to get <a target="_blank" title="Ruby on Rails" href="http://rubyonrails.org/">Ruby on Rails</a> up and running on multiple (Jaunty Jackelope) Ubuntu 9.04 boxes, I came across a few&#8230; gotchas. While the steps described in <a target="_blank" title="Post on Ruby, Rails, and Gems: Getting Started" href="http://dancingpenguinsoflight.com/2009/05/ruby-rails-and-gems-getting-started/">this post</a> will get Ruby, Rails and friends in place and working, there are a few places that have other potentially perilous options resulting in much gnashing of teeth.</p>
<p>What follows are the commands needed to get Rails working on a fresh Ubuntu 9.04 (server) box. To save some copying and pasting you can use <a target="_blank" title="Rails setup script in my github" href="http://github.com/shuckins/sph_code/blob/master/sysadmin/setup/set-up-rails.sh">this script</a> which sets everything up and provides logging.</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get install</span> ruby ruby-dev libopenssl-ruby rdoc irb build-essential<br />
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<br />
<span style="color: #666666; font-style: italic;"># Check here to see if this is the latest: </span><br />
<span style="color: #666666; font-style: italic;"># http://rubyforge.org/frs/?group_id=126</span><br />
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>rubyforge.org<span style="color: #000000; font-weight: bold;">/</span>frs<span style="color: #000000; font-weight: bold;">/</span>download.php<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">60718</span><span style="color: #000000; font-weight: bold;">/</span>rubygems-1.3.5.tgz<br />
<span style="color: #c20cb9; font-weight: bold;">tar</span> xzvf rubygems-1.3.5.tgz<br />
<span style="color: #7a0874; font-weight: bold;">cd</span> rubygems-1.3.5<span style="color: #000000; font-weight: bold;">/</span><br />
<span style="color: #c20cb9; font-weight: bold;">sudo</span> ruby setup.rb<br />
<span style="color: #666666; font-style: italic;"># Without this 'gem' will either not work or will be something else:</span><br />
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>gem1.8 <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>gem<br />
<span style="color: #666666; font-style: italic;"># Test:</span><br />
gem <span style="color: #660033;">--version</span><br />
<span style="color: #666666; font-style: italic;"># Should be: 1.3.5</span><br />
<span style="color: #c20cb9; font-weight: bold;">sudo</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> rails<br />
<span style="color: #666666; font-style: italic;"># Test:</span><br />
rails <span style="color: #660033;">--version</span><br />
<span style="color: #666666; font-style: italic;"># Should be: Rails 2.3.2 (or whatever is latest)</span><br />
<span style="color: #666666; font-style: italic;"># To get sqlite setup (default Rails DB backend):</span><br />
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get install</span> sqlite3 <br />
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> libsqlite3-dev<br />
<span style="color: #c20cb9; font-weight: bold;">sudo</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> sqlite3-ruby</div></td></tr></tbody></table></div>
<p><strong>Warnings</strong>:</p>
<ul>
<li>Don&#8217;t install gem with apt-get. This is not RubyGems. And don&#8217;t even install rubygems via apt-get. Install it from RubyForge.</li>
<li>Don&#8217;t forget to make the symlink from gem1.8. This can cause no end of pain if you didn&#8217;t listen to the last warning.</li>
<li>After RubyGems is in place, install Rails and other related items you need with it. Don&#8217;t use apt-get for these.</li>
</ul>
<p>For more information on setup, covering DB and web server options on Ubuntu, check out the <a target="_blank" title="Ruby on Rails Ubuntu Community Documentation" href="https://help.ubuntu.com/community/RubyOnRails">Community Guide</a>.</p>
<p>[EDIT, 2009-10-04]: I just tried starting up Rails installed through the process above on a fresh Ubuntu 9.04 desktop. Turned out I also had to install libopenssl-ruby via apt-get. This is apparently due to some splitting of packages in the Ubuntu repo.</p>
    ]]></content:encoded>
			<wfw:commentRss>http://dancingpenguinsoflight.com/2009/05/rails-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

