V
V
Vayladion Gognazdiak2018-01-18 20:47:05
Ruby on Rails
Vayladion Gognazdiak, 2018-01-18 20:47:05

Why is gem redis not loading?

Good day.
There is ruby ​​2.4.1 + rails 5.1.4. Raised ActionCable. In dev, it works fine with both adapter async and redis.
Prod has the following error:

[2018-01-18 20:31:52.197] ERROR -- Specified 'redis' for Action Cable pubsub adapter, but the gem is not loaded. Add `gem 'redis'` to your Gemfile (and ensure its version is at the minimum required by Action Cable).: nil

At the same time, sidekiq works fine and the cache too.
Where to dig?
Regarding the use of AC and redis, there is an indication:

# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 3.0'

cable.yml
production:
  adapter: redis
  url: redis://localhost:6379
development:
  adapter: async

gemfile
source 'http://rubygems.org'

git_source(:github) do |repo_name|
  repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
  "https://github.com/#{repo_name}.git"
end

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.1.4'

# Use Postgresql as DB.
gem 'pg', '0.21.0'

# Serialization
gem 'active_model_serializers'

# Admin panel
gem 'activeadmin', github: 'activeadmin'

# Auth
gem 'devise'

# Translit
gem 'translit'

# Video player
gem 'rails-jwplayer'

# Web servers
gem 'puma'

# Zip archiver
gem 'rubyzip', '>= 1.2'

# Images upload and processing
gem 'carrierwave'
gem 'carrierwave-base64' # API Base64 upload
gem 'mini_magick'

# HTTP Client
gem 'httparty'

# Task Scheduler
gem 'rufus-scheduler'

gem 'bcrypt'

gem 'slim'

# Redis cache
gem 'redis'#, '~> 4.0.0'
gem 'redis-namespace'
gem 'redis-rails'
gem 'redis-rack-cache'
gem 'redis-store'#, '~> 1.4.0'

# Pagination
gem 'kaminari'
gem 'api-pagination'
gem 'grape'

gem 'exception_notification'

# gem 'simple_form'

# HTML Editor
gem 'tinymce-rails'

# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'

# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'

group :development do
  # Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
  gem 'web-console', '>= 3.3.0'
  gem 'listen', '>= 3.0.5', '< 3.2'
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
end

# Deploy
group :development do
  gem 'capistrano', '3.10.1'
  gem 'capistrano-rails'
  gem 'capistrano-rvm'
  gem 'capistrano-postgresql'
  gem 'capistrano3-puma'
  gem 'capistrano3-nginx'
  gem 'capistrano-sidekiq'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'rack-cors', :require => 'rack/cors'

just in case redis in Gemfile.lock
redis (4.0.1)
    redis-actionpack (5.0.2)
      redis-rack (>= 1, < 3)
      redis-store (>= 1.1.0, < 2)
    redis-activesupport (5.0.4)
      redis-store (>= 1.3, < 2)
    redis-namespace (1.6.0)
      redis (>= 3.0.4)
    redis-rack (2.0.4)
      redis-store (>= 1.2, < 2)
    redis-rack-cache (2.0.2)
      redis-store (>= 1.2, < 2)
    redis-rails (5.0.2)
      redis-actionpack (>= 5.0, < 6)
      redis-activesupport (>= 5.0, < 6)
      redis-store (>= 1.2, < 2)
    redis-store (1.4.1)
      redis (>= 2.2, < 5)
      redis (>= 3.3.4, < 5)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Demidenko, 2018-01-18
@etspring

You yourself answered your own question:

As for using AC and redis, there is an indication:
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 3.0'

It is written to use version 3, and you have 4)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question