update and install Gemfile as Listing 3.1
use dynamic secret_token, ref:Listing 3.2
change Securerandom to SecureRandom