1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

初めてのRailsアプリ作成手順まとめ

Posted at

🔧 1. 必要なものをインストールしよう
まずはアプリを作る前に、準備が必要です。

✔ インストールしておくべきもの
Ruby(3.x 以上がおすすめ)

Rails(gem install rails)

Node.js(JavaScriptを動かすため)

Yarn(CSS・JSライブラリ管理)

PostgreSQL(データベース)

Git(コード管理)

例:Rails をインストール

gem install rails

🏗️ 2. 新しいアプリを作ろう
ターミナルで作りたい場所に移動して、アプリを作成します。

rails new my_app_name -d postgresql
cd my_app_name

ポイント:

-d postgresql は「PostgreSQLを使うよ」という意味

my_app_name は好きなアプリ名に変えてOK

🔃 3. データベースを作成
アプリの中に入ったら、データベースを作成します。

bin/rails db:create

成功すればOKです!

🏃 4. サーバーを立ち上げてみよう
実際にアプリを起動して、ブラウザで見てみましょう!

bin/dev
または
rails server

📁 5. Gitで管理しよう(おすすめ)
コードをしっかり管理しておくために Git を使います。

git init
git add .
git commit -m "初期コミット"

✨ まとめ
手順 内容
① 必要なものをインストール
② rails new で新規アプリ作成
③ db:create でデータベース準備
④ rails server で起動して確認
⑤ Gitでバージョン管理も忘れずに!

1
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?