Search code examples
ruby-on-rails-6stimulus-reflex

rails aborted! Don't know how to build task 'stimulus_reflex:install'


bundle exec rails stimulus_reflex:install

gave me this error,
rails aborted! Don't know how to build task 'stimulus_reflex:install'

why?

(Commands in sequence...

  1. rails new --skip-spring --webpack=stimulus chatter
  2. yarn add redis cable_ready stimulus_reflex
  3. bundle exec rails stimulus_reflex:install

rails aborted! Don't know how to build task 'stimulus_reflex:install'


Solution

  • Stimulus Reflex has a server and a client part. With yarn you only add the client part. You need to install stimulus_reflex by adding it to your Gemfile or running bundle add stimulus_reflex

    The docs explain how to set it up nicely: https://docs.stimulusreflex.com/setup