This is a pre-configured rails 7 app with some additional libraries and config that I prefer as a generic foundation for new apps. Those are:
/config/credentials/.gitignore
file. This will allow your encrypted config files to be commited with git. Don't worry: the top-level .gitignore
still includes ignoring the test, development, and production keys from the credentials folder!bundle install
to install back end dependencies/config/credentials/<environment>.yml.enc
file (and key) via EDITOR=nano rails credentials:edit -e <environment>
. The final file should look like the following but include your creds. I use sublime, so I run EDITOR="subl --wait" rails credentials:edit -e <environment>
. Having a blank instead of your creds will work fine if you don't need creds for that environment:postgres:
host: <eg. 127.0.0.1>
username: <eg. rails_core_developer>
password: <eg. 1234>
rake db:setup
to create, migrate, and seed test & dev databasesyarn install
to install front-end dependencieschmod -R u+x bin
to change the permissions of executables and prevent getting an access denied error.# Run postgres. Only needs to be run once per restart.
# You can also configure it to run automatically on startup
sudo service postgresql start
# Use Foreman to run the server and recompile CSS/JS
# assets with any changes
bin/dev
# Alternately, to run just the server without being able
# to reload changes to the CSS/JS
rails s
# And if you do need to do a one off recompilation of assets
rails assets:precompile
bundle exec rspec