[RUBY] How to specify db when creating an app with rails

How to specify db when creating an app with rails

It's easy, but it's a memorandum of commandment to me who often forgets to specify the DB and makes an application.

Database specification

When doing rails new, specify the database and create an application. If you do not specify anything, the database defaults to sqlite, so do it when you want to use Mysql etc.

Example

$rails new app name--database=mysql

There is also such a thing in a simplified writing style. Example

$rails new app name-d mysql

This is easier and nicer, -d means database.

I wrote it as a memorandum easily.

Recommended Posts

How to specify db when creating an app with rails
How to push an app developed with Rails to Github
How to get started with creating a Rails app
Summary of initial work when creating an app with Rails
Downgrade an existing app created with rails 5.2.4 to 5.1.6
[Rails] How to build an environment with Docker
How to make an almost static page with rails
How to automatically generate ER diagram when migrating with Rails6
How to set environment variables when using Payjp with Rails
[rails] How to display db information
I want to push an app made with Rails 6 to GitHub
How to make an app using Tensorflow with Android Studio
How to get along with Rails
How to crop an image with libGDX
[Rails] How to use rails console with docker
Introduced Vue.js to an existing Rails app
How to resolve errors when installing Rails 5.1.3
Introduced Vuetify to an existing Rails app
How to build Rails 6 environment with Docker
[Rails] How to apply the CSS used in the main app with Administrate
How to make an app with a plugin mechanism [C # and Java]
[Rails] How to write when making a subquery
[Swift] How to link the app with Firebase
[Validation] rails How to specify after today's date
Rails6.0 ~ How to create an eco-friendly development environment
[Rails MySQL] How to reset DB on heroku
[Rails] How to easily implement numbers with pull-down
How to build API with GraphQL and Rails
Note: Cheat sheet when creating Rails Vue app
I'm making an Android app and I'm stuck with errors and how to solve it
How to deal with FATAL: role "admin0" does not exist and PG :: ConnectionBad: FATAL: role "admin0" does not exist when executing rails db: create
How to write Rails
How to uninstall Rails
How to make batch processing with Rails + Heroku configuration
[Rails] How to search by multiple values ​​with LIKE
How to delete a new_record object built with Rails
How to manually generate a JWT with Rails Knock
[Ruby On Rails] How to reset DB in Heroku
How to output standard from an array with forEach
An introductory book to read when you start Rails
[How to insert a video in haml with Rails]
[Rails] How to deal with URL changes after render
How to query Array in jsonb with Rails + postgres
[Docker + Rails] How to deal with Rails server startup failure
[Rails] How to display an image in the view
After installing'devise''bootstrap' of gemfile with rails, what to do when url is an error
Creating an EC site with Rails5 ①-App configuration, various gem preparation, Model / Routing creation-
[Rails] How to solve the error "undefined method` visit'" when using Capybara with Rspec
When creating an app with the new command in Ruby on Rails bundler: failed to load command: spring (/ Users/user name/directory name to create the app/app name/vendor/bundle/ruby ​​/ 2.6.0/bin/spring )
How to create an application
[rails] How to post images
[Rails] How to use enum
[Rails] I tried to create a mini app with FullCalendar
[iOS] [Objective-C] How to update a widget from an Objective-C app
[Rails] How to install devise
How to write in Model class when you want to save binary data in DB with PlayFramework
[Rails] How to use enum
How to read rails routes
What to check when rails db: migration does not pass
How to use rails join
How to number (number) with html.erb