- Set secret key:
To create a secret key, run the following command:
bundle exec rake secretCopy the secret key and put it toconfig/secrets.ymlfile with the following format:
production:
secret_key_base: <%=ENV["SECRET_KEY_BASE"]%>
- Create credentials
- Remove the old credentials:
rm config/credentials.yml.enc - Create a new one:
EDITOR='nano --wait' RAILS_ENV=production bin/rails credentials:edit
-
Create a database:
RAILS_ENV=production rails db:create db:migrate db:seed -
To precompile your assets, run
RAILS_ENV=production rake assets:precompile. This will create a folderpublic/assetscontains all of your assets. -
Run
RAILS_ENV=production rails sand you should see your app.
- Create credentials file:
rails encrypted:edit config/credentials/staging.yml.enc --key config/credentials/staging.key
This going to create a two files:
+ /config/credentials/staging.key
+ /config/credentials/staging.yml.enc
- Update credential files:
EDITOR=nano rails encrypted:edit config/credentials/staging.yml.enc --key config/credentials/staging.key