LoginSignup
2
0

More than 3 years have passed since last update.

Railsを使った新規アプリ立ち上げの流れ

Last updated at Posted at 2020-03-29

Railsを使った新規アプリ立ち上げの流れを簡単におさらい

使用するコマンド一覧
・rails new
・bundle install
・rails db:create
・rails

新規アプリの立ち上げ

ターミナル
#以下のコードを順に入力、実行すれば完了です。

     入力するコマンド             コマンドの説明
-----------------------      -------------------------
$ rails new sample_app     新規アプリ作成(アプリ名:sample_app)
$ cd sample_app          ディレクトリの移動(※忘れがち)
$ bundle install               gemのインストール
$ rails db:create            データベースの作成
$ rails s                ローカルサーバーの起動

プラウザで localhost:3000 と入力。
もしくは http://localhost:3000 ⬅️こちらをクリック

以下のような画面が表示されればアプリの立ち上げ完了です。
アプリの立ち上げ.jpg

備考

rails new のコマンドは以下のように、より詳細に設定を加えることができます。

$ rails _5.2.3_ new sample_app -d mysql
     ------      ---------  --------
       ①            ②      ③

①railsのバージョン指定(5.2.3) ②アプリ名 ③オプション(データベースとしてmysqlを指定)
②は必須項目
①③は任意の設定
2
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
2
0