Clone Instrumental Template to a new app
How to clone Instrumental Template to a new app
If you're starting a totally fresh app and don't want to use Instrumental Template, then use these instructions instead. Otherwise, read on to use Instrumental Template for this new app.
Clone the Instrumental Template repo
git clone https://github.com/CasJam/instrumental-template.git new_app_name
CD to the new app
cd new_app_name
Remove the git repo
rm -rf .git
Initialize a new git repo
git init
Initial commit
git add .
git commit "initial commit"
Create GitHub Repository
In my CasJam Github account, create a new github repo here
Assuming you've already initiated git in the project folder, you now add the github repo as a remote and push to it (replace PROJECTNAME)
git remote add origin https://github.com/CasJam/PROJECTNAME.git
git push -u origin main
Find and replace the following terms:
Change these to the new app's name:
Instrumental Template
InstrumentalTemplate
instrumental_template
instrumental
Bundle Install
bundle
Create the db
rails db:create
Run migrations
rails db:migrate
Connect to database in TablePlus app
For the development database:
host: localhost
username: (can leave blank)
password: (can leave blank)
database_name: Find this in config/database.yml. It's probably projectname_development
port: 5432 (leave it as default)
Run the server
./bin/dev
Start new Rails Credentials
If the cloned (new) app has files inside of config/credentials, then delete all of them. Then run:
EDITOR="nano" bin/rails credentials:edit --environment development
EDITOR="nano" bin/rails credentials:edit --environment staging
EDITOR="nano" bin/rails credentials:edit --environment test
EDITOR="nano" bin/rails credentials:edit --environment production
That will open the "nano" editor in terminal, which you can use to save the credentials file for the first time. After that, use my commannds for editing rails credentials in Sublime, etc.
Last updated