I always do this<br><br><ul><li>keep my standard database.yml as a database.example.yml</li><li>keep database.yml out of version control</li><li>for a dev setup copy database.example.yml -> database.yml</li></ul>can't remember where I picked this up from<br>

but it seems to work.<br><br><div class="gmail_quote">On 14 April 2010 00:28, Tim Cowlishaw <span dir="ltr"><<a href="mailto:tim@timcowlishaw.co.uk">tim@timcowlishaw.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

aah, that's useful, thanks! Have decided to go with an unchecked-in database.yml but will take note.<br>
<div><div></div><div class="h5"><br>
On 13 Apr 2010, at 00:47, Alex MacCaw wrote:<br>
<br>
> You need to eval the production file with the current context, like so:<br>
><br>
>         config = configuration # Need local config variable<br>
>         eval(IO.read(path), binding, path)<br>
><br>
> Alex<br>
><br>
>> ----------------------------------------------------------------------<br>
>><br>
>> Message: 1<br>
>> Date: Mon, 12 Apr 2010 17:07:44 +0100<br>
>> From: Tim Cowlishaw <<a href="mailto:tim@timcowlishaw.co.uk">tim@timcowlishaw.co.uk</a>><br>
>> To: LRUG LRUG <<a href="mailto:chat@lrug.org">chat@lrug.org</a>><br>
>> Subject: [LRUG] requiring one rails environment from another<br>
>> Message-ID: <<a href="mailto:2097FF98-1CDD-46A9-847E-DA9060CDBBED@timcowlishaw.co.uk">2097FF98-1CDD-46A9-847E-DA9060CDBBED@timcowlishaw.co.uk</a>><br>
>> Content-Type: text/plain; charset=us-ascii<br>
>><br>
>> Hey there chaps,<br>
>><br>
>> I'm in the middle of setting up a CI server for our office and have run into what seems like a slight gotcha.<br>
>><br>
>> Basically, i need to set up a seperate rails environment called something like "CI", so that the CI server can have its own mysql credentials, rather than requiring all users to user the same. So, i set this up in database.yml, and create a ci.rb file in config/environments that contains only a "require File.dirname(__FILE__)+ '/test.rb'" to load in the regular test environment. However, as the code in the required file isn't evaled in the same context as where the 'require' happens - it fails with "undefined local variable or method `config' for main:Object" on the line "config.cache_classes = true", the first line in the required 'test.rb'.<br>


>><br>
>> Clearly I'm going about this the wrong way - has anyone else any bright ideas about allowing two distinct environments to share configuration, without resorting to putting it all in environment.rb?<br>
>><br>
>> Cheers,<br>
>><br>
>> Tim<br>
>><br>
</div></div><div><div></div><div class="h5">> _______________________________________________<br>
> Chat mailing list<br>
> <a href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a><br>
> <a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
<br>
_______________________________________________<br>
Chat mailing list<br>
<a href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a><br>
<a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
</div></div></blockquote></div><br>