Rails 3 - Speed up Console Loading Time

后端 未结 6 1721
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-02 07:55

I am wondering if there is any relatively easy way to speed up my console load time, which is starting to approach 30 seconds. I have a lot of subclasses whose methods don\

6条回答
  •  南方客
    南方客 (楼主)
    2020-12-02 08:31

    Reload! has been an issue for some time now. Have a look at this. There are some patches which you could use and some tips on how you maybe able to get around your issue.

    The reload method itself looks like this.

    # reloads the environment
    def reload!(print=true)
      puts "Reloading..." if print
      ActionDispatch::Callbacks.new(lambda {}, false).call({})
      true
    end
    

    You could always add you environment to this method to override it function and force the reload you require.

    This has worked for me so let us know if it works for you. All the best.

提交回复
热议问题