提交 6b248f6e 编写于 作者: J José Valim

Add more information to comments.

上级 1ba22bcd
......@@ -33,13 +33,15 @@
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册