<?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>SimianLogic Studios &#187; insoshi</title>
	<atom:link href="http://www.simianlogicstudios.com/tag/insoshi/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.simianlogicstudios.com</link>
	<description>indie game developer, web tinkerer, and transplanted Southerner living in Silicon Valley</description>
	<lastBuildDate>Thu, 18 Feb 2010 16:38:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Insoshi, Meet Heroku</title>
		<link>http://www.simianlogicstudios.com/2008/04/30/insoshi-meet-heroku/</link>
		<comments>http://www.simianlogicstudios.com/2008/04/30/insoshi-meet-heroku/#comments</comments>
		<pubDate>Thu, 01 May 2008 01:36:34 +0000</pubDate>
		<dc:creator>SimianLogic</dc:creator>
				<category><![CDATA[heroku]]></category>
		<category><![CDATA[insoshi]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[web tinkering]]></category>

		<guid isPermaLink="false">http://simianlogic3d.com/blog/2008/04/30/insoshi-meet-heroku/</guid>
		<description><![CDATA[(Images lost in the Great Update of 2009)
When I read about insoshi on Mashable and TechCrunch this morning, it got my mind buzzing&#8230; and immediately my thoughts turned to another Y Combinator startup&#8211;Heroku.  I&#8217;ve been using Heroku for quite awhile now, and both my fondness for Ruby on Rails and my disdain (so far) [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;">(Images lost in the Great Update of 2009)</p>
<p>When I read about <a title="insoshi" href="http://simianlogic3d.com/blog/insoshi.com" target="_blank">insoshi</a> on <a title="Mashable" href="http://mashable.com/2008/04/30/insoshi/" target="_blank">Mashable</a> and <a title="TechCrunch" href="http://www.techcrunch.com/2008/04/29/social-networking-goes-open-source-with-insoshi/" target="_blank">TechCrunch</a> this morning, it got my mind buzzing&#8230; and immediately my thoughts turned to another Y Combinator startup&#8211;Heroku.  I&#8217;ve been using Heroku for quite awhile now, and both my fondness for Ruby on Rails and my disdain (so far) for Google&#8217;s Big Table make it my prototyping engine of choice for the time being.  The integration is not perfect by any stretch of the imagination, but here&#8217;s a quick and dirty way to get an insoshi install running on Heroku (assuming you have an acccount):</p>
<p><strong> First Steps</strong></p>
<ol>
<li>Download the insoshi tarball</li>
<li>Create a new heroku app</li>
<li>Import the insoshi tarball (how convenient is it that the heroku app importer wants a tarball!)</li>
<li>Run rake db:migrate (this will run a ton of migrations&#8230; once complete you can press escape to close the little popup)</li>
<li>Run rake install (this will create the default preferences file and the default forum.</li>
</ol>
<p><span id="more-87"></span><strong>Hiccup #1</strong>The session variable in Heroku is enormous&#8230; so jamming it into the pageviews table causes the app to choke.  Solution: well, we&#8217;ll just toss out that data for now.  I&#8217;ll try to come up with a more elegant solution later, but for now the goal is simply getting the app to run.  The stack trace points you to Line #30 of app/controllers/application.rb, where the page_view is inserted.  Comment out Line #32 (<span class="comment"><span class="symbol">&#8220;:session</span> =&gt; session,&#8221;) and save.  If you refresh the app, you should now get a totally blank screen.</span></p>
<p><strong>Hiccup #2</strong></p>
<p>There seems to be some sort of conflict between the Heroku toolbar and the css of the stock insoshi install.  Luckily, this is fixable.  Go into your config directory and create a new file, &#8220;heroku.yml&#8221;. Add two variables and save the file:</p>
<blockquote>
<div id="canvas">
<div><span class="css_property_name">toolbar_collaborators</span>: false</div>
<div><span class="css_property_name">toolbar_public</span>: false</div>
</div>
</blockquote>
<p>Refresh the app again and you will now see the blank install of insoshi!  We&#8217;re not quite out of the woods yet, though.</p>
<div><strong>Hiccup #3</strong></div>
<p>Log in to your default account.  The email address will be &#8220;admin@example.com&#8221; and the password will be &#8220;admin&#8221;.  Insoshi will immediately prompt you to change these away from the defaults.</p>
<p>Changing anything on the profile-edit page and pressing submit will take you straight to another rails crash&#8230; but this one is a little misleading.  Your edits actually went through fine, it&#8217;s the redirect that&#8217;s crashing.  There&#8217;s a SQL call on Line #310 of  app/models/person.rb that needs to be modified to be compatible.  What was originally:</p>
<blockquote><p><em>sql = %(SELECT connections.*, COUNT(contact_id) FROM `connections`<br />
WHERE ((person_id = ? OR person_id = ?)<br />
AND status=?)<br />
GROUP BY contact_id<br />
HAVING count(contact_id) = 2)</em></p></blockquote>
<p>Should be changed to:</p>
<blockquote><p><em>sql = %(SELECT contact_id, COUNT(contact_id) FROM connections<br />
WHERE ((person_id = ? OR person_id = ?)<br />
AND status=?)<br />
GROUP BY contact_id<br />
HAVING count(contact_id) = 2)</em></p></blockquote>
<p>Note that actually TWO changes have been made.  First change &#8220;connections.*&#8221; to &#8220;contact_id&#8221;.  Second, get rid of the goofy ` characters surrounding the word connections in the FROM clause.  Refresh the page and you should now be good to go on viewing user pages.  You may need to kick your Heroku app to get it to restart (I usually just change a single character in the config/routes.rb file and save for lack of a reset button).</p>
<p><strong>Hiccup #4</strong></p>
<p>This one&#8217;s a little obscure.  Sign out of your account and click on the &#8220;People&#8221; tab.  Click on the one user (&#8221;admin&#8221;), and rails will complain once more.  I haven&#8217;t quite figured out WHY this one is breaking, but I did trace it back and toss in a workaround.  The error occurs on Line #42 of app/views/people/show.html.erb.  If you call Connection.connected?(SOME_PERSON, nil) in the Heroku console, the app will correctly return false.  Though you are not logged in, the current_user variable is actually set to &#8220;false&#8221; as well.  Calling Connection.connected?(SOME_PERSON, false) causes it to choke, which is why Rails is throwing errors.  Rather than trace backwards further to see why the app was setting current_user to false, I took the shortcut: I installed an  block surrounding that block of code&#8230; Voila!  Did I mention this was a quick &amp; dirty install?</p>
<p>As far as I can tell, that&#8217;s it!  You should now have a working install of insoshi to go play around with.  The session logging is a little broken, but it&#8217;s really all you need to start tinkering.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simianlogicstudios.com/2008/04/30/insoshi-meet-heroku/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
