-
create new secret token with
rake secret
-
Created file ‘config/initializers/secret_token.rb’ with the following content (!replace token value with the created one!)
Dursty::Application.config.secret_token = '6324721ab9d42748219...'
-
(If you’re using capistrano deploy) Save this file on your production server in the shared folder and link it via deploy task (similar to the following):
namespace :deploy do
[...]
desc "Create symlinks"
task :symlink, :roles => :app do
run "ln -nfs #{release_path}/../../shared/database.yml #{release_path}/config/database.yml"
run "ln -nfs #{release_path}/../../shared/secret_token.rb #{release_path}/config/initializers/secret_token.rb"
[...]
end
end
before 'deploy:assets:precompile', 'deploy:symlink_db'