2012-02-19 67 views

回答

5

您可以在以下塊添加到config/boot.rb運行命令,當應用程序被關閉:

at_exit do 
    puts "Shutting the app down..." 
end 

這是你在你的服務器過程中看到輸出:

[Swanny ~/Sites/test_app]$ bundle exec thin start 
>> Using rack adapter 
>> Thin web server (v1.3.1 codename Triple Espresso) 
>> Maximum connections set to 1024 
>> Listening on 0.0.0.0:3000, CTRL+C to stop 
^C>> Stopping ... 
Shutting the app down... 
相關問題