diff options
author | José Valim <jose.valim@gmail.com> | 2010-09-30 10:33:31 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-09-30 10:33:31 +0200 |
commit | 6b248f6ea56b318d39b8c28b2a9f69a7d420f1fb (patch) | |
tree | 19307c101a6231eb8adee887bed9973f9a1dbf56 /railties/lib | |
parent | 1ba22bcde1d5ee1e16e14d4d2dd23cbeb01cd59f (diff) | |
download | rails-6b248f6ea56b318d39b8c28b2a9f69a7d420f1fb.tar.gz rails-6b248f6ea56b318d39b8c28b2a9f69a7d420f1fb.tar.bz2 rails-6b248f6ea56b318d39b8c28b2a9f69a7d420f1fb.zip |
Add more information to comments.
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/commands.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/railties/lib/rails/commands.rb b/railties/lib/rails/commands.rb index 60b9a55d80..e3aa6d7c3e 100644 --- a/railties/lib/rails/commands.rb +++ b/railties/lib/rails/commands.rb @@ -33,13 +33,15 @@ when 'console' Rails::Console.start(Rails.application) when 'server' - # try to guess application's path if there is no config.ru file in current dir - # it allows to run script/rails server from other directories + # Change to the application's path if there is no config.ru file in current dir. + # This allows us to run script/rails server from other directories, but still get + # the main config.ru and properly set the tmp directory. Dir.chdir(File.expand_path('../../', APP_PATH)) unless File.exists?(File.expand_path("config.ru")) require 'rails/commands/server' Rails::Server.new.tap { |server| - # we need to require application after the server sets environment + # We need to require application after the server sets environment, + # otherwise the --environment option given to the server won't propagate. require APP_PATH Dir.chdir(Rails.application.root) server.start |