Check out the course on LinkedIn Learning.
I hit some problems with getting mysql
installed on my MacBook Air M1. Here are the resources that helped me get it working:
- https://gorails.com/setup/osx/11-big-sur
- https://stackoverflow.com/questions/45474191/an-error-occurred-while-installing-mysql2-0-4-8-and-bundler-cannot-continue
# Start up your database server
/opt/homebrew/bin/mysql.server start
# Start up your webserver
rails server
- Create a new controller:
rails generate controller ExampleController view
- Generate migration:
rails generate migration DoNothingYet
- Working with migrations:
rails db:migrate rails db:migrate VERSION=0 rails db:migrate:status rails db:migrate VERSION=20211211125002 rails db:migrate:up VERSION=20211211125002 rails db:migrate:down VERSION=20211211125002 rails db:migrate:redo VERSION=20211211125002
- Generate a model:
rails generate model SingularName
- Loads IRB (Interactive Ruby) but with Rails:
rails console rails c
- Open the rails console in development environment:
rails console development
- View a list of all the configured routes:
rails routes
- Clear the web logs:
rails log:clear to clear the log