Rails3: changing the location of the temp directory (tmp)

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

Therefore, I am looking for a configuration setting to host the tmp folder outside the Rails-app package. Is it possible?

+5
source share
4 answers

Not the answer you are looking for, but I can definitively say that there is no configuration option to change where Rails finds the tmp folder. The location is hard-coded in many different places in the Rails database.

, symlink , , , .

, , , .. Dropbox , tmp, Dropbox.

, Rails ~/work/rails_project/<all the rails dirs including tmp>, Dropbox, ~/dropbox/rails_project, , , tmp one, bash, :

$ for f in ~/work/rails_project/*; do ln -s $f; done
$ rm tmp

, , / .

+6
ENV['TMPDIR'] = Rails.root.join('tmp')
+4

tmp, tmp.

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

configuration.rb

+2

Dropbox : http://www.dropbox.com/help/175/en

Dropbox Advanced. " " , [ , 1- ]

+1

All Articles