Rails3: Change location of temp (tmp) directory

前端 未结 4 693
傲寒
傲寒 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条回答
  •  离开以前
    2021-01-18 19:19

    Not the answer you're looking for - but I can definitively say that there's no configuration option to change where Rails thinks the tmp folder is. The location is hard coded in many different places in the Rails codebase.

    Looks like the symlink will sync the original file, so you'll probably have the same locking problems.

    If you do, then you can just use the symlinks the other way around to solve your problem, ie. create your project outside your dropbox, and symlink everything other than tmp into a folder in your dropbox.

    So you might have your Rails app in ~/work/rails_project/ and then you'll have a corresponding dir in your dropbox, like ~/dropbox/rails_project and then inside that dir you'll manually create a bunch of symlinks and then delete the tmp one, using bash you'd do this:

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

    You'd need to remember to run that again if you ever added a new file/directory to the root of your app.

提交回复
热议问题