diff options
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/commands/server.rb | 4 | ||||
-rw-r--r-- | railties/lib/rails/initializer.rb | 7 |
2 files changed, 7 insertions, 4 deletions
diff --git a/railties/lib/rails/commands/server.rb b/railties/lib/rails/commands/server.rb index 25f5a8ada5..a600e1e9db 100644 --- a/railties/lib/rails/commands/server.rb +++ b/railties/lib/rails/commands/server.rb @@ -44,10 +44,6 @@ end puts "=> Booting #{ActiveSupport::Inflector.demodulize(server)}" puts "=> Rails #{Rails.version} application starting on http://#{options[:Host]}:#{options[:Port]}}" -%w(cache pids sessions sockets).each do |dir_to_make| - FileUtils.mkdir_p(File.join(RAILS_ROOT, 'tmp', dir_to_make)) -end - if options[:detach] Process.daemon pid = "#{RAILS_ROOT}/tmp/pids/server.pid" diff --git a/railties/lib/rails/initializer.rb b/railties/lib/rails/initializer.rb index 8a34411ce7..3065a8d111 100644 --- a/railties/lib/rails/initializer.rb +++ b/railties/lib/rails/initializer.rb @@ -195,6 +195,13 @@ module Rails plugin_loader.add_plugin_load_paths end + # Create tmp directories + Initializer.default.add :ensure_tmp_directories_exist do + %w(cache pids sessions sockets).each do |dir_to_make| + FileUtils.mkdir_p(File.join(configuration.root_path, 'tmp', dir_to_make)) + end + end + # Loads the environment specified by Configuration#environment_path, which # is typically one of development, test, or production. Initializer.default.add :load_environment do |