Created
September 8, 2011 21:18
-
-
Save rdj/1204763 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Restart unicorn through RVM to allow for ruby interpreter version upgrades | |
| rvm_shell = '/home/deploy/.rvm/bin/rvm-shell' | |
| unicorn_args = Unicorn::HttpServer::START_CTX[:argv].join(' ') | |
| shell_args = [ '-c', "cd /u/apps/innerfence/current && exec bundle exec unicorn #{unicorn_args}" ] | |
| Unicorn::HttpServer::START_CTX[0] = rvm_shell | |
| Unicorn::HttpServer::START_CTX[:argv] = shell_args | |
| # Scrub the environment | |
| before_exec do |server| | |
| ENV.delete_if { |k| k.starts_with? 'BUNDLE' } | |
| ENV.delete_if { |k| k.starts_with? 'GEM' } | |
| ENV.delete_if { |k| k.starts_with? 'RUBY' } | |
| ENV.delete_if { |k| k.starts_with? 'rvm' } | |
| ENV.delete 'IRBRC' | |
| ENV.delete 'MY_RUBY_HOME' | |
| ENV['PATH'] = ENV['PATH'].split(/:/).reject{ |p| p =~ /[.]rvm/ }.join(':') | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment