Im using windows 10 on this project with ruby version 2.6.5 and rails version 6.0.2 with bundler version 2.1.4.

However if I tried bundle install including gem 'recommendify', it will fail.

I tried deleting the old lock file then executing bundle install but issue still occurs.
I also tried re-installing ruby with development kit but still same problem.

Here is my Gemfile:

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git"

ruby '~> 2.6.5'

gem 'rails', '~> 6.0.2'
gem 'mysql2'
gem 'puma', '~> 3.11'
gem 'sass-rails', '~> 5.0'
gem 'webpacker', '~> 4.0'
gem 'coffee-rails', '~> 5.0.0' 
gem 'jquery-rails'
gem 'jbuilder', '~> 2.7'
gem 'sdoc', '~> 1.0', group: :doc
gem 'bootsnap', '>= 1.4.2', require: false

gem 'devise'
gem 'devise-two-factor'
gem 'rqrcode'
gem 'kaminari'
gem 'settingslogic'
gem 'paperclip'
gem 'rest-client', require: false

group :development, :test, :staging do
  gem 'pry-rails'  
  gem 'pry-doc'    
  gem 'pry-byebug' 
  gem 'pry-stack_explorer' 
end
gem 'ransack' 
gem 'active_link_to' 
gem 'gretel' 
gem 'whenever' 
gem 'meta-tags', '~> 2.11.1' 
gem 'just-datetime-picker'
gem 'jquery-ui-rails' 
gem 'kakurenbo-puti' 
gem 'jpmobile' 
gem 'slim-rails' 
gem 'html2slim' 
gem 'sitemap_generator' 
gem 'devise_invitable' 
gem 'font-awesome-rails' 

gem 'wicked_pdf' 
gem 'wkhtmltopdf-binary' if RUBY_PLATFORM =~ /darwin/
gem 'carrierwave', '~> 2.0'
gem 'draper' 

gem 'wkhtmltopdf-binary-edge-alpine', '~> 0.12.5.0' if RUBY_PLATFORM =~ /linux/
gem 'impressionist'
gem 'exception_notification'
gem 'slack-notifier'
gem 'redis', '~> 3.3.3' 
gem 'redis-namespace'
gem 'recommendify'
gem 'active_hash'
gem 'wareki'
gem 'tzinfo-data'
gem 'mimemagic', github: 'mimemagicrb/mimemagic', ref: '01f92d86d15d85cfd0f20dabd025dcbd36a8a60f'

group :development do
  gem 'ruby_dig', '~> 0.0.2'
end

gem 'kramdown'
gem 'remotipart' 
gem 'aws-sdk-s3', '~> 1'
gem 'nested_form'
gem 'enum_help'
gem 'i18n_generators' 
gem 'split', require: 'split/dashboard'

group :development, :test, :staging do
  gem 'byebug'
end

group :development, :staging do
  gem 'web-console', '~> 3.0'
end

group :production, :staging do
  gem 'fog-aws'
end

group :development do
  gem 'bullet'
  gem 'foreman', require: false 
  gem 'letter_opener'
  gem 'letter_opener_web'
  gem 'rubocop', require: false
  gem 'rubocop-airbnb'
  gem 'rails-erd'
  gem 'slim_lint'
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
end

group :development, :test do
  gem 'rspec-rails' 
  gem 'factory_bot_rails' 
  gem 'faker'                  
  gem 'spring-commands-rspec'  
end

group :test do
  gem 'database_cleaner'
  gem 'timecop'
  gem 'simplecov', '~> 0.21.2', require: false
  gem 'capybara'
  gem 'launchy'
  gem 'selenium-webdriver'
  gem 'webdrivers'
end

Here is where the error begins:

Using redis 3.3.5
Fetching recommendify 0.3.8
Installing recommendify 0.3.8 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: C:/Ruby26/lib/ruby/gems/2.6.0/gems/recommendify-0.3.8/ext
C:/Ruby26/bin/ruby.exe -I C:/Ruby26/lib/ruby/2.6.0 -r
./siteconf20210510-3880-ihgz9k.rb extconf.rb

current directory: C:/Ruby26/lib/ruby/gems/2.6.0/gems/recommendify-0.3.8/ext
make "DESTDIR=" clean
rm -f *.o

current directory: C:/Ruby26/lib/ruby/gems/2.6.0/gems/recommendify-0.3.8/ext
make "DESTDIR="
mkdir -p ../bin
gcc -Wall recommendify.c -lhiredis -o ../bin/recommendify
recommendify.c:4:10: fatal error: hiredis/hiredis.h: No such file or directory
    4 | #include <hiredis/hiredis.h>
      |          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:4: build] Error 1

make failed, exit code 2

Gem files will remain installed in
C:/Ruby26/lib/ruby/gems/2.6.0/gems/recommendify-0.3.8 for inspection.
Results logged to
C:/Ruby26/lib/ruby/gems/2.6.0/extensions/x86-mingw32/2.6.0/recommendify-0.3.8/gem_make.out

An error occurred while installing recommendify (0.3.8), and Bundler cannot
continue.
Make sure that `gem install recommendify -v '0.3.8' --source
'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  recommendify

Thanks in advance. Kind of new to ruby.

1

There are 1 best solutions below

0
On

The recommendify gem requires the hiredis client to be installed on the system (and its development headers) to be available. See https://github.com/asmuth/recommendify/issues/8

https://github.com/JaneaSystems/hiredis-windows may be a usable version for Windows. However, you may possibly find other roadblocks which getting this to run on Windows. It might be easier to use Linux or macOS here if possible.

In any case, it appears the the recommendify gem was not updated for 8 years now and thus might show a lot of other incompatibilities with newer software (such as Redis, Ruby, or other gems). If possible, you may investigate on updating to a different maintained library to generate your recommendations.