Ruby on Rails Getting started with Ruby on Rails Create a new Rails app with your choice of database and including the RSpec Testing Tool

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

Rails uses sqlite3 as the default database, but you can generate a new rails application with a database of your choice. Just add the -d option followed by the name of the database.

$ rails new MyApp -T -d postgresql

This is a (non-exhaustive) list of available database options:

  • mysql
  • oracle
  • postgresql
  • sqlite3
  • frontbase
  • ibm_db
  • sqlserver
  • jdbcmysql
  • jdbcsqlite3
  • jdbcpostgresql
  • jdbc

The -T command indicate to skip the installation of minitest. To install an alternative test suite like RSpec, edit the Gemfile and add

group :development, :test do
  gem 'rspec-rails', 
end

Then launch the following command from the console:

rails generate rspec:install


Got any Ruby on Rails Question?