$ cd code/github
$ rbenv global 3.0.0
$ gem update rails
# Powered by postgres and without minitest
$ rails new APP_NAME -d postgresql -T
$ cd APP_NAME
$ git add .
$ git commit -m"Start Rails app"
$ code .$ rails db:create(if needed) Add port: 5433 to config/database.yml
# Gemfile
# Needs to be available in production to seed your heroku DB:
gem 'faker'
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
gem 'annotate'
gem 'factory_bot_rails'
end
# ...
group :development do
gem 'annotate'
# ...
endUpdate bundle:
bundle$ r g scaffold MODEL_NAME name:string
$ r db:migrateAdd some code to the db/seeds.rb and setup the db:
$ r db:seedYou shall now see the a list of your items on localhost:3000/resource
⚠ If you run into webpacker error (Webpacker::Manifest::MissingEntryError), try this: https://stackoverflow.com/a/67158387/5925094
⚠ If you run into EOFError: end of file reached hitting the resources, kill your Docker Rails apps:
$ docker kill $(docker ps -q)
# Reference: EOFError: end of file reachedTo recreate the database:
$ rails db:drop db:create db:migrate db:seed$ heroku create APP-NAME
$ heroku run db:migrate db:seedI don't think you can do db:create/drop but you probably can db:setup.
Subdomain: Create a CNAME record with blub "host" and value of your heroku domain (e.g. app-name.herokuapp.com) inside namecheap and then add your domain to heroku:
$ heroku domains:add blub.richstone.io