can't modify frozen array (TypeError) - config/application.rb:42:in `<<':

后端 未结 1 1103
悲哀的现实
悲哀的现实 2021-01-18 09:56

I have a rails 3 app, and am trying to do testing. I do the following command rspec spec/controllers/ and get the following error:

/config/application.rb:42         


        
1条回答
  •  执笔经年
    2021-01-18 10:24

    Try the method the comments suggest:

    config.autoload_paths += %W{#{config.root}/lib}
    

    This doesn't modify the initial array, but adds the given array to config.autoload_paths and saves it into a new array in config.autoload_paths.

    0 讨论(0)
提交回复
热议问题