Prevent errors in case #{rails_root}/tmp does not exist

Dir.mkdir is not recursive. i.e - It doesn't do the equivalent of `mkdir -p` but just plain `mkdir`.
And that is a problem if #{rails_root}/tmp is missing. More here.
http://meta.discourse.org/t/keep-getting-the-same-error-every-start/8214
This commit is contained in:
J Phani Mahesh 2013-07-09 17:46:54 +05:30
parent a6b63b2871
commit 4fe6bee83c

View File

@ -45,7 +45,9 @@ Bluepill.application("discourse", :base_dir => ENV["HOME"] + '/.bluepill') do |a
app.uid = user
app.working_dir = rails_root
sockdir = "#{rails_root}/tmp/sockets"
tmpdir = "#{rails_root}/tmp"
sockdir = "#{tmpdir}/sockets"
File.directory? tmpdir or Dir.mkdir tmpdir
File.directory? sockdir or Dir.mkdir sockdir
num_webs.times do |i|
app.process("thin-#{i}") do |process|