Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: modules/discourse/files/discourse.fcgi

Issue 9377123: Set up proper FastCGI environment for Discourse and use nginx (Closed)
Patch Set: Cleaner definition of the environment variables Created Feb. 22, 2013, 1:51 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: modules/discourse/files/discourse.fcgi
===================================================================
--- a/modules/discourse/files/discourse.fcgi
+++ b/modules/discourse/files/discourse.fcgi
@@ -1,14 +1,16 @@
#!/usr/bin/ruby
+require 'etc'
+
Dir.chdir(File.dirname(__FILE__))
ENV['RAILS_ENV'] ||= 'production'
-ENV['GEM_HOME'] = File.expand_path('~discourse/.gems')
-ENV['GEM_PATH'] = File.expand_path('~discourse/.gems') + ':/var/lib/gems/1.9.1'
+ENV['GEM_HOME'] = "#{Etc.getpwuid.dir}/.gems"
+ENV['GEM_PATH'] = "#{ENV['GEM_HOME']}:/var/lib/gems/1.9.1"
require 'fcgi'
require_relative 'config/environment'
class Rack::PathInfoRewriter
def initialize(app)
@app = app
end
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld