Skip to content

Instantly share code, notes, and snippets.

@nandosola
Created April 3, 2013 08:55
Show Gist options
  • Save nandosola/5299581 to your computer and use it in GitHub Desktop.
Save nandosola/5299581 to your computer and use it in GitHub Desktop.
Torquebox needs its tmpdirs to be set by applications
#... requires
ENV['RACK_ENV'] ||= 'development'
# This tempdir stuff is important for Torquebox deployments
(tmp = '.'
dirs = [ENV['TMPDIR'], ENV['TMP'], ENV['TEMP'], '/tmp', tmp]
for dir in dirs
unless dir.nil?
stat = File.stat(dir)
if stat.directory? and stat.writable? and !stat.world_writable?
puts "**** tmpdir will be #{dir}"
break
end
end
end) if %w(production staging).include?ENV['RACK_ENV']
TorqueBox.configure do
web do |web|
web.context '/fileserver'
end
ruby do
version '1.9'
end
environment do
TMPDIR '/var/torquebox'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment