14
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Rails5アプリでのRedisの使い方

Last updated at Posted at 2017-08-23

・前提
Redisは導入済み

・Redisの設置場所
which redis-server
/usr/local/bin/redis-server

Redis導入後、bundle exec rails s を実行して発生したエラー

・エラー文
Redis::CannotConnectError - Error connecting to Redis on 127.0.0.1:6379 (Errno::ECONNREFUSED):

・対応策
.envにREDIS_HOST=localhostREDIS_PORT=6379を追記

REDIS_HOST=localhost
REDIS_PORT=6379

追記後に、ターミナルを2つ立ち上げる。両方とも該当アプリのcdに移動する。
1つで、 redis-server
もう一つで bundle exec rails s

以上

14
9
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
14
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?