<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Better setup for environments in Rails</title>
	<atom:link href="http://blog.smartlogicsolutions.com/2008/06/02/better-setup-for-environments-in-rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.smartlogicsolutions.com/2008/06/02/better-setup-for-environments-in-rails/</link>
	<description>News and updates from the people at SmartLogic Solutions</description>
	<lastBuildDate>Sat, 17 Dec 2011 12:57:18 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Tony Amoyal</title>
		<link>http://blog.smartlogicsolutions.com/2008/06/02/better-setup-for-environments-in-rails/comment-page-1/#comment-2826</link>
		<dc:creator>Tony Amoyal</dc:creator>
		<pubDate>Thu, 28 May 2009 22:34:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/2008/06/02/better-setup-for-environments-in-rails/#comment-2826</guid>
		<description>Hey John,

You raise some interesting points here and this is a well written post.  I am currently building and deploying my first production rails app.

However, something really bothers me about keeping a production config in the repo.  Mainly that I don&#039;t believe every developer should have access to production credentials.  I plan to implement a method close to the one described in &quot;Agile Web Development with Rails&quot;. I will keep the database.yml out of the repo and put it in a protected directory on my server then use a capistrano hook to copy the database.yml to the prod repo after deployment. 

I think following this route will allow me to better secure the production credentials.</description>
		<content:encoded><![CDATA[<p>Hey John,</p>
<p>You raise some interesting points here and this is a well written post.  I am currently building and deploying my first production rails app.</p>
<p>However, something really bothers me about keeping a production config in the repo.  Mainly that I don&#8217;t believe every developer should have access to production credentials.  I plan to implement a method close to the one described in &#8220;Agile Web Development with Rails&#8221;. I will keep the database.yml out of the repo and put it in a protected directory on my server then use a capistrano hook to copy the database.yml to the prod repo after deployment. </p>
<p>I think following this route will allow me to better secure the production credentials.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Trupiano</title>
		<link>http://blog.smartlogicsolutions.com/2008/06/02/better-setup-for-environments-in-rails/comment-page-1/#comment-711</link>
		<dc:creator>John Trupiano</dc:creator>
		<pubDate>Wed, 24 Dec 2008 15:42:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/2008/06/02/better-setup-for-environments-in-rails/#comment-711</guid>
		<description>Hi Sam,

Thanks for the suggestion to use raise in lieu of exit.  It is valuable to maintain the stack trace.  I&#039;ve updated the post (and the environmentalist library at http://github.com/jtrupiano/environmentalist) to reflect this change.

-John</description>
		<content:encoded><![CDATA[<p>Hi Sam,</p>
<p>Thanks for the suggestion to use raise in lieu of exit.  It is valuable to maintain the stack trace.  I&#8217;ve updated the post (and the environmentalist library at <a href="http://github.com/jtrupiano/environmentalist" rel="nofollow">http://github.com/jtrupiano/environmentalist</a>) to reflect this change.</p>
<p>-John</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam</title>
		<link>http://blog.smartlogicsolutions.com/2008/06/02/better-setup-for-environments-in-rails/comment-page-1/#comment-616</link>
		<dc:creator>Sam</dc:creator>
		<pubDate>Sat, 06 Dec 2008 21:29:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/2008/06/02/better-setup-for-environments-in-rails/#comment-616</guid>
		<description>This is a very easy and simple way to separate the environment database files. I would make one fix to anyone using this method, in config/postboot.rb, exit should not be used and raise should be. Raising allows rails to produce a trace and will not break console interactions within Aptana.

So instead of the unless... exit(1) end sections, use:
raise &quot;Environment directory `#{env_dir}&#039; does not exist&quot; unless File.directory?(env_dir)
raise &quot;Environment file `#{env_file}&#039; does not exist&quot; unless File.exists?(env_file)
raise &quot;Database file `#{db_file}&#039; does not exist&quot; unless File.exists?(db_file)</description>
		<content:encoded><![CDATA[<p>This is a very easy and simple way to separate the environment database files. I would make one fix to anyone using this method, in config/postboot.rb, exit should not be used and raise should be. Raising allows rails to produce a trace and will not break console interactions within Aptana.</p>
<p>So instead of the unless&#8230; exit(1) end sections, use:<br />
raise &#8220;Environment directory `#{env_dir}&#8217; does not exist&#8221; unless File.directory?(env_dir)<br />
raise &#8220;Environment file `#{env_file}&#8217; does not exist&#8221; unless File.exists?(env_file)<br />
raise &#8220;Database file `#{db_file}&#8217; does not exist&#8221; unless File.exists?(db_file)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SmartLogic Solutions Blog &#187; Blog Archive &#187; Introducing environmentalize: an intuitive, environment-focused config structure for your rails applications</title>
		<link>http://blog.smartlogicsolutions.com/2008/06/02/better-setup-for-environments-in-rails/comment-page-1/#comment-171</link>
		<dc:creator>SmartLogic Solutions Blog &#187; Blog Archive &#187; Introducing environmentalize: an intuitive, environment-focused config structure for your rails applications</dc:creator>
		<pubDate>Mon, 04 Aug 2008 19:30:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/2008/06/02/better-setup-for-environments-in-rails/#comment-171</guid>
		<description>[...] couple of months ago, I wrote an article (Better setup for environments in rails) discussing the standard set of changes we make to the config structure of each of our rails [...]</description>
		<content:encoded><![CDATA[<p>[...] couple of months ago, I wrote an article (Better setup for environments in rails) discussing the standard set of changes we make to the config structure of each of our rails [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rick</title>
		<link>http://blog.smartlogicsolutions.com/2008/06/02/better-setup-for-environments-in-rails/comment-page-1/#comment-63</link>
		<dc:creator>rick</dc:creator>
		<pubDate>Thu, 12 Jun 2008 14:23:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/2008/06/02/better-setup-for-environments-in-rails/#comment-63</guid>
		<description>New developers have to create a database.yml (we have an app:bootstrap task that sets up the database.yml, the schema, and any initial data that&#039;s needed for a quick script/server demo), but that&#039;s it.  Usually they don&#039;t need the staging or production info.  

But who knows, we have maybe 5 developers in my small company, usually all working on different things.  I imagine the practices would have to evolve as the size of the team grows.</description>
		<content:encoded><![CDATA[<p>New developers have to create a database.yml (we have an app:bootstrap task that sets up the database.yml, the schema, and any initial data that&#8217;s needed for a quick script/server demo), but that&#8217;s it.  Usually they don&#8217;t need the staging or production info.  </p>
<p>But who knows, we have maybe 5 developers in my small company, usually all working on different things.  I imagine the practices would have to evolve as the size of the team grows.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Trupiano</title>
		<link>http://blog.smartlogicsolutions.com/2008/06/02/better-setup-for-environments-in-rails/comment-page-1/#comment-62</link>
		<dc:creator>John Trupiano</dc:creator>
		<pubDate>Thu, 12 Jun 2008 12:04:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/2008/06/02/better-setup-for-environments-in-rails/#comment-62</guid>
		<description>Nice-- so you more or less simulate an svn:externals.  I do like keeping configuration out of the same repository, but does it add extra steps when a new developer hops onto the project?

People raised some interesting points at Bmore on Rails.  One I particularly liked was completely leaving SCM off of production servers by doing local checkouts and rsync&#039;ing.  Your procedure could fit in here when the local copy is checked out.  Another thing to point out is that I&#039;m currently leaving all of my non-production configuration on the production box (shame on me).  It&#039;s not simple to restrict a single directory from being checked out (an ignore won&#039;t work, because you want those files in dev).  I suppose your process would also aid me here.</description>
		<content:encoded><![CDATA[<p>Nice&#8211; so you more or less simulate an svn:externals.  I do like keeping configuration out of the same repository, but does it add extra steps when a new developer hops onto the project?</p>
<p>People raised some interesting points at Bmore on Rails.  One I particularly liked was completely leaving SCM off of production servers by doing local checkouts and rsync&#8217;ing.  Your procedure could fit in here when the local copy is checked out.  Another thing to point out is that I&#8217;m currently leaving all of my non-production configuration on the production box (shame on me).  It&#8217;s not simple to restrict a single directory from being checked out (an ignore won&#8217;t work, because you want those files in dev).  I suppose your process would also aid me here.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rick</title>
		<link>http://blog.smartlogicsolutions.com/2008/06/02/better-setup-for-environments-in-rails/comment-page-1/#comment-61</link>
		<dc:creator>rick</dc:creator>
		<pubDate>Thu, 12 Jun 2008 10:26:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/2008/06/02/better-setup-for-environments-in-rails/#comment-61</guid>
		<description>My approach to this issue is a bit different.  After working with some smart sysadmins on a certain client project, and working with Engineyard, one common thread popped up: Using git to store things like your various server config files.  In the same way, you can also store your production specific database.yml and any config initializers in git also.  You can symlink these in the after callback for deploy:symlink_configs.

I only like my approach slightly better because a) it doesn&#039;t require any changes to the framework or app config files, and b) I&#039;m not checking those files into the same git repo as my application.</description>
		<content:encoded><![CDATA[<p>My approach to this issue is a bit different.  After working with some smart sysadmins on a certain client project, and working with Engineyard, one common thread popped up: Using git to store things like your various server config files.  In the same way, you can also store your production specific database.yml and any config initializers in git also.  You can symlink these in the after callback for deploy:symlink_configs.</p>
<p>I only like my approach slightly better because a) it doesn&#8217;t require any changes to the framework or app config files, and b) I&#8217;m not checking those files into the same git repo as my application.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

