Permalink
Browse files

Move the ensure_tmp_directories_exist initializer to the application …

…object
  • Loading branch information...
1 parent e4d7e50 commit feb04bf897dc3d904379d400f568b80116b18551 Carl Lerche committed Oct 8, 2009
Showing with 7 additions and 7 deletions.
  1. +7 −0 railties/lib/rails/application.rb
  2. +0 −7 railties/lib/rails/initializer.rb
@@ -98,5 +98,12 @@ def new
require 'active_support/dependencies'
plugin_loader.add_plugin_load_paths
end
+
+ # Create tmp directories
+ initializer :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
end
end
@@ -116,13 +116,6 @@ def self.run(initializer = nil, config = nil)
end
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

1 comment on commit feb04bf

woodie commented on feb04bf Nov 26, 2009

This is a problem for a few reasons.

  • FileUtils was (probably) required by rubygems. When you use bundler instead, FileUtils is not known.
  • The dirs are created over and over again, even if they exist already.
  • We need to skip over this based on some flag that indicates a read-only file system.

This is one of the last issues holding up Rails 3 on App Engine.

Please sign in to comment.