Recently I had to build one Rails app off a clone of another Rails app. I wanted to find a quick way to change the secret token in config/initializers/secret_token.rb. IRB makes it easy:

$ irb
>> require 'securerandom'
=> true
>> SecureRandom.hex(64)
=> "3fe397575565365108556c3e5549f139e8078a8ec8fd2675a83de96289b30550a266ac04488d7086322efbe573738e7b3ae005b2e3d9afd718aa337fa5e329cf"
>> exit

Edit: Rails has actually built-in a Rake task (since 2007) to do this as well:

$ rake secret