LoginSignup
0
0

Ruby on Rails (React on Webpacker) でアプリを作成してみた

Last updated at Posted at 2024-05-10

1 - Project Setup

①プロジェクトフォルダを作成する

mkdir プロジェクト名

②railsのプロジェクトを作成する

rails new backend -d postgresql --api

②reactのプロジェクトを作成する

npx create-react-basic frontend

③backend/config/database.ymlを編集する

backend/config/database.yml

development:
  <<: *default
  database: backend_development
  username: test
  password: test
  
//省略

test:
  <<: *default
  database: backend_test
  username: test
  password: test

//省略

production:
  <<: *default
  database: backend_production
  username: test
  password: test

④psqlと入力してpostgresコンソールに移動

cd backend
psql
clear

⑤ データベースを作成する

rails db:create

参考サイト

AM Coder - Ruby on Rails + React #1 - Project Setup

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0