LoginSignup
0
0

More than 1 year has passed since last update.

rails アプリ作成 rails6(準備編)

Posted at

初学者のためメモみたいな感じです。
間違ってるところあればコメントで指摘してください!

0.githubにリポジトリ作成

1.rails new

rails _6.1.4_ new session_login -d postgresql

                    |ver.|             | ファイル名|

2.ディレクトリに移動

$ cd session_login

~/workspace/session_login (master) $ のようにディレクトリを移動したこと確認!!

忘れないように、githubと紐付けもしとく。
git add .
git commit -m"メッセージ"
git push

3.データベースの作成

rails db:createを実行することによって、config/database.ymlの設定に従って、データベースを作成する!

$ rails db:create

ターミナルのログでは、以下のようにデータベースが作成される

Created database 'session_login_development'
Created database 'session_login_test'

4.Webサーバを起動する

Webサーバを起動して、アクセス。

$ rails s

localhost:3000にアクセスする

ブラウザを開いてlocalhost:3000にアクセス。Ruby on Railsでサーバーを起動してデフォルトページが表示されれば成功!!

これでアプリケーション作成準備ができた!

rails _6.1.4_ new session_login -d postgresql のコマンドを実行することで、Ruby on Railsバージョン6.1.4のアプリを、session_loginという名前で、postgresqlを使用して作成できる。
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