- For Windows: RubyInstaller
- For Linux: Ruby Installation Guide
To install Rails, run the following command:
gem install rails
To create a new Rails application, use the following command, replacing <app-name>
with your desired application name:
rails new <app-name>
Navigate to your application directory and start the Rails server with:
rails server
To create a new model, use the following command, replacing <model-name>
with your desired model name:
rails generate model <model-name>
To create a new scaffold, use the following command, replacing <model-name>
with your desired model name:
rails generate scaffold <model-name>
To apply the migrations and update the database schema, use the following command:
rails db:migrate