How to reflect seeds.rb in production environment

Introduction

When migrating from the development environment to the production environment, the contents of seeds.rb are not carried over to the database of the production environment, so it is necessary to reflect seeds.rb in the database in the production environment.

environment

procedure

  1. Log in to EC2.
  2. Move to the created app.
cd app name
  1. Change to the current directory.
 cd current
  1. Execute the rails command.
 rails db:seed RAILS_ENV=production

that's all

At the end

It may be a difficult article to understand because it is a beginner + Qiita's first post, but I hope it helps.

Recommended Posts

How to reflect seeds.rb in production environment
How to use environment variables in RubyOnRails
[Rails] How to execute "rails db: create" etc. in production environment EC2
[Rails] How to reset the database in production environment (Capistrano version)
How to install Titan2D (v4.2.0) in virtual environment
[Rails] How to use PostgreSQL in Vagrant environment
How to create a Java environment in just 3 seconds
[Rails] How to delete production environment MySQL data after putting it in the development environment
What happened in "Java 8 to Java 11" and how to build an environment
[Docker context] ~ How to access docker in remote environment from VScode ~
How to use Lombok in Spring
How to find May'n in XPath
How to hide scrollbars in WebView
How to run JUnit in Eclipse
How to iterate infinitely in Ruby
[Note] Update to production environment [heroku]
[Rails] How to write in Japanese
How to run Ant in Gradle
How to master programming in 3 months
How to learn JAVA in 7 days
Create a database in a production environment
How to get parameters in Spark
How to install Bootstrap in Ruby
How to use InjectorHolder in OpenAM
[Note] Update to production environment (heroku)
How to introduce jQuery in Rails 6
How to use classes in Java?
How to name variables in Java
How to set Lombok in Eclipse
How to concatenate strings in java
How to install Swiper in Rails
Java-database connection Java-MySQL connection ③-1: How to set CLASSPATH in environment variable / September 2017
How to install the language used in Ubuntu and how to build the environment
I want to display the images under assets/images in the production environment
[swift5] How to specify color in hexadecimal
How to implement search functionality in Rails
How to implement date calculation in Java
Multilingual Locale in Java How to use Locale
How to change app name in rails
How to get date data in Ruby
How to use custom helpers in rails
How to use named volume in docker-compose.yml
How to filter JUnit Test in Gradle
How to insert a video in Rails
How to standardize header footer in Thymeleaf
How to include Spring Tool in Eclipse 4.6.3?
How to add jar file in ScalaIDE
How to install production Metabase on Ubuntu
How to do base conversion in Java
[Swift] How to fix Label in UIPickerView
How to have params in link_to method
How to use Docker in VSCode DevContainer
How to use MySQL in Rails tutorial
How to fix system date in JUnit
How to implement coding conventions in Java
How to embed Janus Graph in Java
[rails] How to configure routing in resources
[Note] Update to production environment (AWS EC2)
How to map tsrange type in Hibernate
How to get the date in java
How to implement ranking functionality in Rails