Now Playing Tracks

This is not the error you’re looking for…

So I was working on a small rails project yesterday & trying to get devise auth to work with couchdb(using the couchrest gem). I got one of these errors:

Rails::Application::RoutesReloader#execute_if_updated delegated to updater.execute_if_updated, but updater is nil

Not very descriptive for debugging. Some googling found me this issue on the rails github page: https://github.com/rails/rails/issues/10559

And led me to a quick fix I could use to get to the bottom of the issue. I figured out where activesupport was installed on my system, and opened up /lib/active_support/core_ext/module/delegation.rb

Towards the bottom of the file, I changed:


module_eval(<<-EOS, file, line - 2)
  def #{method_prefix}#{method}(#{definition})                                          # def customer_name(*args, &block)
   _ = #{to}
   _.#{method}(#{definition}) 
   _.name(*args, &block)
   rescue NoMethodError => e
   rescue NoMethodError => e
     if _.nil? && e.name == :#{method}
       if _.nil? && e.name == :name
         #{exception}
      else
      raise
    end    
  end      
EOS

to:


module_eval(<<-EOS, file, line - 5)
  def #{method_prefix}#{method}(#{definition}) 
    customer_name(*args, &block)
    _ = #{to}
    if _.nil?
      #{exception}
    end
    _.#{method}(#{definition})
  end
EOS

Restarted my server, & got the error I needed to be able to fix the problem. Mission Accomplished.

This fix should be rolled into rails master soon.

To Tumblr, Love Pixel Union