2012-02-19 11 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... 
関連する問題