# Empty rails log folder

**URL:** <https://www.ruby-forum.com/t/empty-rails-log-folder/181915>\
**Category:** Rails\
**Created:** [January 20, 2010, 4:56am UTC](https://www.ruby-forum.com/t/empty-rails-log-folder/181915 "2010-01-20T04:56:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Learn\_by\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/e274bd/32.png) [@Learn\_by\_D](https://www.ruby-forum.com/u/Learn_by_D)\
**Post date:** [January 20, 2010, 4:56am UTC](https://www.ruby-forum.com/t/empty-rails-log-folder/181915/1 "2010-01-20T04:56:08Z")

</div>

The rails log folder is in my .gitignore file. That means the log  
folder is not in the repository. When I deploy my rails app to the  
staging server via git pull, the app refuses to work because it does  
not see a log folder. I have to manually create an empty log folder  
for it to put log files such as acts\_as\_ferret log inside. So now I  
have to commit an empty log folder to the git repository so that I  
don’t have to manually create an empty log folder after a git pull on  
the staging server. Is there a better way?

Thanks.

---

<div class="post-metadata">

**Author:** ![Learn\_by\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/e274bd/32.png) [@Learn\_by\_D](https://www.ruby-forum.com/u/Learn_by_D)\
**Post date:** [January 20, 2010, 5:45am UTC](https://www.ruby-forum.com/t/empty-rails-log-folder/181915/2 "2010-01-20T05:45:53Z")

</div>

On Tue, Jan 19, 2010 at 7:54 PM, Vincent P [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 

Vincent, you .gitignore should look something like this:

.gitignore:

.DS\_Store Note: You should add this line if you’re  
working  
on Mac OS 10.x  
config/database.yml Note: You may or may not want to check your  
database.yml into the repositoty.  
log/_.log  
tmp/\*\*/_  
db/\*.sqlite3 Note: You should add this line of you’re  
using a  
SQLite database

Next, you should do the following:

$ touch log/.gitignore tmp/.gitignore vendor/.gitignore  
$ git add .  
$ git commit -a -m "

Good luck,

-Conrad

---

<div class="post-metadata">

**Author:** ![Learn\_by\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/e274bd/32.png) [@Learn\_by\_D](https://www.ruby-forum.com/u/Learn_by_D)\
**Post date:** [January 20, 2010, 10:37am UTC](https://www.ruby-forum.com/t/empty-rails-log-folder/181915/3 "2010-01-20T10:37:21Z")

</div>

2010/1/20 Vincent P [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> The rails log folder is in my .gitignore file. Â That means the log  
> folder is not in the repository. Â When I deploy my rails app to the  
> staging server via git pull, the app refuses to work because it does  
> not see a log folder. Â I have to manually create an empty log folder  
> for it to put log files such as acts\_as\_ferret log inside. Â So now I  
> have to commit an empty log folder to the git repository so that I  
> don’t have to manually create an empty log folder after a git pull on  
> the staging server. Â Is there a better way?

Instead of using a top level .gitignore to ignore all files in the log  
folder (so the folder does not appear in the repository) put a  
.gitignore inside the log folder itself to ignore the log files. Then  
commit log/.gitignore so the folder appears in the repository.

Colin
