This assumes that you have already created a subversion repository, and you are just wondering how to setup your rails project.

# Import your rails application.  
## navigate to the root of your rails app.
## <pre><code>svn import . svn_url_to_your_repository</code></pre>

# Check out your rails application
## <pre><code>svn checkout svn_url_to_your_repository</code></pre>
## navigate to the root of this freshly checked out repository.

# Remove the log files. 
## <pre><code>svn remove log/*</code></pre>
## <pre><code>svn commit -m 'removing all log files from subversion'</code></pre>

# Ignore the log files when they are re-created
## <pre><code>svn propset svn:ignore "*.log" log/</code></pre>
## <pre><code>svn update log/</code></pre>
## <pre><code>svn commit -m 'Ignoring all files in /log/ ending in .log'</code></pre>

# Don't version control database.yml
## <pre><code>svn move config/database.yml config/database.example</code></pre>
## <pre><code>svn commit -m 'Moving database.yml to database.example to provide a template for anyone who checks out the code'</code></pre>

# Ignore database.yml when it's re-created
## <pre><code>svn propset svn:ignore "database.yml" config/</code></pre>
## <pre><code>svn update config/</code></pre>
## <pre><code>svn commit -m 'Ignoring database.yml'</code></pre>

You're done.  Now your log files will not be checked into subversion on a commit, and you don't need to worry about the database settings on your development machine and your production machine and things breaking as database.yml moves between them.

Feel free to skip the steps where you remove database.yml, but if you are working with several other programmers who may have different database.yml files you may want to keep it ignored.

--

Another solution to accomodate multiple developer's database setup would be to grab those parameters from the "environment", each programmer's own development environment that is.  You could write database.yml like so:

<pre><code>development:
  adapter: mysql
  database: <%= ENV['DEV_DB'] %>
  host: <%= ENV['DEV_HOST'] %>
  username: <%= ENV['DEV_USER'] %>
  password: "<%= ENV['DEV_PASS'] %>"
</code></pre>

Even production params could be specified like this too, which would help keep sensitive info out of the code repository.

*WARNING*
Settings environment variables on a shared host could be insecure.  If you can run everything setuid and make your .[shell]rc and .htaccess files mode 0700 this would be a little more acceptable on a shared host.

--

*Adding _all_ new files to Subversion after running a generate script:*

 Subversion has an option for "svn add" to make things much easier, by using "svn add * --force".
** <pre><code>svn --force add .</code></pre>

--

I found that svn add * --force is not a perfect solution, as it will force to add ignored resources into repository. In my machin, It automatically adds my ignored *.log files into respository. Those log files are ignored by using <pre>svn propset svn:ignore *.log log/</pre>
Is this a bug of SVN? 

--

As my development work shifts between *nix and Windows machines - each environment has Ruby installed in a different location, so each require a different shebang (#!) line at the start of all 'dispatch.*' files. To deal with this I perform a similar manoeuvre to that described above for database.yml.

* Don't version control dispatch.* files
** <pre><code>svn move public/dispatch.rb public/dispatch.rb.example</code></pre>
** <pre><code>svn move public/dispatch.cgi public/dispatch.cgi.example</code></pre>
** <pre><code>svn move public/dispatch.fcgi public/dispatch.fcgi.example</code></pre>
** <pre><code>svn commit -m 'Moving dispatch.* to dispatch.*.example to provide a template.'</code></pre>

* Ignore dispatch.* files when re-created
** <pre><code>svn propedit svn:ignore public/</code></pre>

This will launch subversion's default text editor, and if you type and save the following info:
<pre><code>dispatch.rb
dispatch.cgi
dispatch.fcgi</code></pre>
...it should add these properties to subversion.

* Commit these changes
** <pre><code>svn update public/</code></pre>
** <pre><code>svn commit -m 'Ignoring dispatch.* files'</code></pre>

That should be that, so that now when I initially check out the project on whatever machine, I just need to create the dispatch.* files from the samples, make sure the shebang line is correct, and away I go.
