rmosolgo / react-rails-hot-loader

Live-reload React.js components with Ruby on Rails & react-rails
MIT License
88 stars 24 forks source link

Undefined method to_prepare #20

Open Seybo opened 7 years ago

Seybo commented 7 years ago

Hi. For the first time trying your gem and here is what I get on rails 5.1.3 and react-rails 2.2.1

It seems there is no server running or you are not in a rails project root directory => Booting Puma => Rails 5.1.3 application starting in development on http://localhost:3000 => Run rails server -h for more startup options Exiting /home/glaux/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/react-rails-hot-loader-0.8.0/lib/hot_loader/railtie.rb:14:in block in <class:Railtie>' : undefined methodto_prepare' for ActionDispatch::Reloader:Class (NoMethodError)

HardikUPurohit commented 6 years ago

@Seybo Have you got the solution?

Seybo commented 6 years ago

@HardikUPurohit Nope. It's not worth it anyway. Just forgot it. Too many problems with this hot reloading thing AFAIS

buildWithSoul commented 6 years ago

damn i just got the same issue as well

aynul commented 6 years ago

same thing

garmoshka-mo commented 3 years ago

It's because of deprecated code. As hotfix add this patch to config/initializers/patches.rb

ActionDispatch::Reloader.class_eval do

  def self.to_prepare &block
    ActiveSupport::Reloader.to_prepare &block
  end

end