0
0

More than 1 year has passed since last update.

Rails 環境構築

Last updated at Posted at 2022-02-20

Homebrewをインストールする

からコピペで実行

rbenvをインストールする

brew install rbenv

rbenvにPATHを通す

echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile

echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile

source ~/.bash_profile

1行ずつ実行

Rubyをインストールする

rbenv install -l

すきなバージョンをインストール

rbenv install 2.7.1

ローカルで使うRubyのバージョンを指定する

rbenv local 2.7.1

Bundlerをインストールする

gem install bundler

yarnをインストール

brew install yarn

Rails install

gem install rails -v 6.0.3.2

MySQLインストール

brew install mysql

参考
https://qiita.com/fuku_tech/items/a380ebb1fd156c14c25b

新規Railsアプリケーションを作成する

作りたいディレクトリに移動して

rails _6.0.3.2_ new アプリケーション名 --database=mysql

DB作る

rails db:create

DB 起動と止める

 mysql.server start
 mysql.server stop

サーバー立ち上げる

rails s
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