method
set_root_path!
v2.2.1 -
Show latest stable
- Class:
Rails::Configuration
set_root_path!()public
Set the root_path to RAILS_ROOT and canonicalize it.
# File railties/lib/initializer.rb, line 768
def set_root_path!
raise 'RAILS_ROOT is not set' unless defined?(::RAILS_ROOT)
raise 'RAILS_ROOT is not a directory' unless File.directory?(::RAILS_ROOT)
@root_path =
# Pathname is incompatible with Windows, but Windows doesn't have
# real symlinks so File.expand_path is safe.
if RUBY_PLATFORM =~ /(:?mswin|mingw)/
File.expand_path(::RAILS_ROOT)
# Otherwise use Pathname#realpath which respects symlinks.
else
Pathname.new(::RAILS_ROOT).realpath.to_s
end
Object.const_set(:RELATIVE_RAILS_ROOT, ::RAILS_ROOT.dup) unless defined?(::RELATIVE_RAILS_ROOT)
::RAILS_ROOT.replace @root_path
end Related methods
- Instance methods
- after_initialize
- after_initialize_blocks
- breakpoint_server
- breakpoint_server=
- builtin_directories
- database_configuration
- environment
- environment_path
- framework_paths
- gem
- plugins=
- reload_plugins?
- set_root_path!
- threadsafe!
- to_prepare
- Class methods
- new
- Private methods
-
default_cache_classes -
default_cache_store -
default_controller_paths -
default_database_configuration_file -
default_dependency_loading -
default_eager_load_paths -
default_frameworks -
default_gems -
default_load_once_paths -
default_load_paths -
default_log_level -
default_log_path -
default_plugin_loader -
default_plugin_locators -
default_plugin_paths -
default_plugins -
default_routes_configuration_file -
default_view_path -
default_whiny_nils -
framework_root_path