Permalink
Browse files

fix up merb-fcgi binary to work out of the box

  • Loading branch information...
Ezra Zygmuntowicz
Ezra Zygmuntowicz committed Mar 24, 2008
1 parent 3a13dac commit b5467e5138b8c18c0c521a5fce5ea529f1a090d6
Showing with 11 additions and 12 deletions.
  1. +11 −12 merb-gen/app_generators/merb/templates/public/merb.fcgi
@@ -2,22 +2,21 @@
require 'rubygems'
require 'merb-core'
# this is Merb.root, change this if you have some funky setup.
merb_root = File.expand_path(File.dirname(__FILE__) / '../')
# If the fcgi process runs as apache, make sure
# we have an inlinedir set
# we have an inlinedir set for Rubyinline action-args to work
unless ENV["INLINEDIR"] || ENV["HOME"]
tmpdir = File.dirname(__FILE__) + "/../tmp"
tmpdir = merb_root / "tmp"
unless File.directory?(tmpdir)
Dir.mkdir(tmpdir)
end
ENV["INLINEDIR"] = tmpdir
end
# the merb root should alwasy be located below
# to set the root dir
argv = ARGV + %w[-a fcgi -m ..]
# start
Merb.start(argv)
# start merb with the fcgi adapter, add options or change the log dir here
Merb.start(:adapter => 'fcgi',
:merb_root => merb_root,
:log_file => merb_root /'log'/'merb.log')

0 comments on commit b5467e5

Please sign in to comment.