config/environment.rb in damagecontrol-0.5.0.1393 vs config/environment.rb in damagecontrol-0.5.0.1404
- old
+ new
@@ -27,35 +27,40 @@
# Require Rails gems.
require 'rubygems'
require_gem 'activesupport'
-require_gem 'activerecord'
+#require_gem 'activerecord'
require_gem 'actionpack'
require_gem 'actionmailer'
require_gem 'actionwebservice'
require_gem 'rails'
# Environment-specific configuration.
-require_dependency "environments/#{RAILS_ENV}"
-ActiveRecord::Base.configurations = YAML::load(File.open("#{RAILS_ROOT}/config/database.yml"))
-ActiveRecord::Base.establish_connection
+#require_dependency "environments/#{RAILS_ENV}"
+#ActiveRecord::Base.configurations = YAML::load(File.open("#{RAILS_ROOT}/config/database.yml"))
+#ActiveRecord::Base.establish_connection
# Configure defaults if the included environment did not.
begin
- RAILS_DEFAULT_LOGGER = Logger.new("#{RAILS_ROOT}/log/#{RAILS_ENV}.log")
-rescue StandardError
+# RAILS_DEFAULT_LOGGER = Logger.new("#{RAILS_ROOT}/log/#{RAILS_ENV}.log")
+ require 'damagecontrol/directories'
+ LOG_DIR = File.expand_path("#{DamageControl::Directories.basedir}/log")
+ FileUtils.mkdir_p(LOG_DIR)
+ RAILS_DEFAULT_LOGGER = Logger.new("#{LOG_DIR}/#{RAILS_ENV}.log")
+rescue StandardError => e
RAILS_DEFAULT_LOGGER = Logger.new(STDERR)
RAILS_DEFAULT_LOGGER.level = Logger::WARN
RAILS_DEFAULT_LOGGER.warn(
"Rails Error: Unable to access log file. Please ensure that log/#{RAILS_ENV}.log exists and is chmod 0666. " +
"The log level has been raised to WARN and the output directed to STDERR until the problem is fixed."
)
end
-[ActiveRecord, ActionController, ActionMailer].each { |mod| mod::Base.logger ||= RAILS_DEFAULT_LOGGER }
+#[ActiveRecord, ActionController, ActionMailer].each { |mod| mod::Base.logger ||= RAILS_DEFAULT_LOGGER }
+[ActionController, ActionMailer].each { |mod| mod::Base.logger ||= RAILS_DEFAULT_LOGGER }
[ActionController, ActionMailer].each { |mod| mod::Base.template_root ||= "#{RAILS_ROOT}/app/views/" }
ActionController::Routing::Routes.reload
Controllers = Dependencies::LoadingModule.root(
File.expand_path(File.join(RAILS_ROOT, 'app', 'controllers')),