Rails3: Change location of temp (tmp) directory

前端 未结 4 737
傲寒
傲寒 2021-01-18 18:18

I usually develop in my local Dropbox folder. Some files in the tmp-folder get locked by the browsers (and keep Dropbox busy), Growl throws exceptions and so on.

Th

4条回答
  •  梦毁少年i
    2021-01-18 18:57

    you can't change tmp directory, but you can configure tmp cache directory.

    # config/application.rb
    config.cache_store                   = [ :file_store, "/tmp/rails-cache/" ]
    config.assets.cache_store            = [ :file_store, "/tmp/rails-cache/assets/#{Rails.env}/" ]
    

    you can read more at configuration.rb

提交回复
热议问题