From a018bd261c2001577616c642ece1d162e4efe6c6 Mon Sep 17 00:00:00 2001 From: Ravinder Singh Date: Wed, 31 Mar 2010 15:28:48 +0530 Subject: [PATCH] Create tmp directories if required before starting server --- railties/lib/rails/commands/server.rb | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/railties/lib/rails/commands/server.rb b/railties/lib/rails/commands/server.rb index c57660c..3f74cd4 100644 --- a/railties/lib/rails/commands/server.rb +++ b/railties/lib/rails/commands/server.rb @@ -54,6 +54,11 @@ module Rails trap(:INT) { exit } puts "=> Ctrl-C to shutdown server" unless options[:daemonize] + #Create required tmp directories if not found + %w(cache pids sessions sockets).each do |dir_to_make| + FileUtils.mkdir_p(Rails.root.join('tmp', dir_to_make)) + end + super ensure # The '-h' option calls exit before @options is set. -- 1.6.3.3