5

私は通常、ローカルの Dropbox フォルダーで開発を行います。tmp-folder 内の一部のファイルはブラウザーによってロックされ (そして Dropbox をビジー状態に保ちます)、Growl は例外をスローします。

したがって、tmp-folder を Rails-app バンドルの外に置くための構成設定を探しています。それは可能ですか?

4

4 に答える 4

6

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/<all the rails dirs including tmp> 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.

于 2011-04-26T17:34:05.993 に答える
4
ENV['TMPDIR'] = Rails.root.join('tmp')
于 2011-05-11T02:17:36.730 に答える
2

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をご覧ください。

于 2012-11-27T03:54:14.297 に答える
1

選択的同期を使用して、ディレクトリを Dropbox での同期から除外できます: http://www.dropbox.com/help/175/en

基本的に、Dropbox の設定を選択し、[詳細設定] に移動します。[選択的同期] を選択し、同期から除外するフォルダーを探します [第 1 レベルのディレクトリの深さよりも深い場所に移動する必要がある場合は、詳細ビューもあります]

于 2013-01-26T14:16:54.850 に答える