From 1a7377a984ac850f74bfdad50c63f0c2c946f0a4 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 4 Jul 2005 19:49:40 +0000 Subject: [PATCH] Made gateway.cgi work with a ruby called anything git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1678 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- railties/bin/listener | 6 +++++- railties/bin/tracker | 6 +++++- railties/dispatches/gateway.cgi | 5 +++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/railties/bin/listener b/railties/bin/listener index 2310282204..493ac9dca4 100644 --- a/railties/bin/listener +++ b/railties/bin/listener @@ -2,6 +2,7 @@ require "drb" ENV["RAILS_ENV"] = 'production' require "#{File.dirname(__FILE__)}/../config/environment.rb" require 'fcgi_handler' +require 'rbconfig' VERBOSE = false @@ -90,7 +91,10 @@ if ARGV.shift == 'start-listeners' if number > 1 fork do - exec 'ruby', __FILE__, 'start-listeners', tracker, (number - 1).to_s + exec( + File.join(Config::CONFIG['bin_dir'], Config::CONFIG['RUBY_SO_NAME']), + __FILE__, 'start-listeners', tracker, (number - 1).to_s + ) end end diff --git a/railties/bin/tracker b/railties/bin/tracker index 3a0c3aafc9..17fce67e54 100644 --- a/railties/bin/tracker +++ b/railties/bin/tracker @@ -1,4 +1,5 @@ require "drb" +require "rbconfig" VERBOSE = false @@ -85,7 +86,10 @@ class Tracker tracker_uri = @uri listener_path = File.join(File.dirname(__FILE__), 'listener') fork do - exec 'ruby', listener_path, 'start-listeners', tracker_uri, n.to_s + exec( + File.join(Config::CONFIG['bin_dir'], Config::CONFIG['RUBY_SO_NAME']), + listener_path, 'start-listeners', tracker_uri, n.to_s + ) end end diff --git a/railties/dispatches/gateway.cgi b/railties/dispatches/gateway.cgi index b8d44acef2..d9f0c17846 100644 --- a/railties/dispatches/gateway.cgi +++ b/railties/dispatches/gateway.cgi @@ -2,8 +2,9 @@ # This is an experimental feature for getting high-speed CGI by using a long-running, DRb-backed server in the background -require File.join(File.dirname(__FILE__), 'drb') +require 'drb' require 'cgi' +require 'rbconfig' VERBOSE = false @@ -19,7 +20,7 @@ def start_tracker STDIN.reopen "/dev/null" STDOUT.reopen "/dev/null", "a" - exec 'ruby', tracker_path, 'start', ConnectionUri + exec(File.join(Config::CONFIG['bin_dir'], Config::CONFIG['RUBY_SO_NAME']), tracker_path, 'start', ConnectionUri) end $stderr.puts "dispatch: waiting for tracker to start..." if VERBOSE -- GitLab