LoginSignup
0
0

More than 1 year has passed since last update.

Rails Devise インストール方法

Posted at

このページの目標

DeviseをRailsにインストールする

環境

ruby 2.6.3
rails 2.6
cloud9

Deviseとは

Railsで作成したアプリケーションに、
ユーザー名やメールアドレスを使用してログインを行うなどの認証機能を簡単に実装する事ができるライブラリ(Gem)

1 Gemfileに追加

Gemfileの最終行にDeviseを追加する。

Gemfile
gem 'devise'

注意:deviseをdeviceと記述してしまわないように気をつける

2 アプリケーションに読み込む

追加したGemをアプリケーションに読み込むためにターミナルに記述

$bundle install

Gemを変更したら必ずbundle installのコマンドを実行する

3 初期設定を行う

下記コマンドを実行し、初期設定を行う

$rails g devise:install

上記の表示が出ればインストール&初期設定の完了

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