提交 9f569c60 编写于 作者: P Piotr Sarnacki

Try to guess application's directory while trying to run the server, but only...

Try to guess application's directory while trying to run the server, but only if config.ru is not present in current dir
上级 3049e645
......@@ -33,8 +33,13 @@
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
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
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.
先完成此消息的编辑!
想要评论请 注册