diff --git a/passenger/bin/passenger b/passenger/bin/passenger
index f290ee3..b5131cf 100755
--- a/passenger/bin/passenger
+++ b/passenger/bin/passenger
@@ -25,7 +25,6 @@
source_root = File.expand_path(File.dirname(__FILE__) + "/..")
$LOAD_PATH.unshift("#{source_root}/lib")
-require 'rubygems' rescue nil
require 'phusion_passenger'
require 'phusion_passenger/standalone/main'
diff --git a/passenger/bin/passenger-install-apache2-module b/passenger/bin/passenger-install-apache2-module
index f05eb5e..acf3300 100755
--- a/passenger/bin/passenger-install-apache2-module
+++ b/passenger/bin/passenger-install-apache2-module
@@ -50,7 +50,6 @@ class Installer < PhusionPassenger::AbstractInstaller
Dependencies::Zlib_Dev,
Dependencies::Ruby_DevHeaders,
Dependencies::Ruby_OpenSSL,
- Dependencies::RubyGems,
Dependencies::Rake,
Dependencies::Rack,
Dependencies::Apache2,
diff --git a/passenger/bin/passenger-install-nginx-module b/passenger/bin/passenger-install-nginx-module
index f0783e0..0dbfa77 100755
--- a/passenger/bin/passenger-install-nginx-module
+++ b/passenger/bin/passenger-install-nginx-module
@@ -42,7 +42,6 @@ class Installer < PhusionPassenger::AbstractInstaller
Dependencies::DownloadTool,
Dependencies::Ruby_DevHeaders,
Dependencies::Ruby_OpenSSL,
- Dependencies::RubyGems,
Dependencies::Rake,
Dependencies::Rack,
Dependencies::Curl_Dev,
diff --git a/passenger/helper-scripts/passenger-spawn-server b/passenger/helper-scripts/passenger-spawn-server
index f685275..b4395c1 100755
--- a/passenger/helper-scripts/passenger-spawn-server
+++ b/passenger/helper-scripts/passenger-spawn-server
@@ -72,7 +72,6 @@ begin
source_root = File.expand_path(File.dirname(__FILE__) + "/..")
$LOAD_PATH.unshift("#{source_root}/lib")
- require 'rubygems' rescue nil
require 'phusion_passenger'
require 'phusion_passenger/debug_logging'
require 'phusion_passenger/utils/tmpdir'
diff --git a/passenger/lib/phusion_passenger/abstract_server.rb b/passenger/lib/phusion_passenger/abstract_server.rb
index 430cd3c..50a85bf 100644
--- a/passenger/lib/phusion_passenger/abstract_server.rb
+++ b/passenger/lib/phusion_passenger/abstract_server.rb
@@ -168,12 +168,6 @@ class AbstractServer
# double-closing already closed file descriptors.
close_all_io_objects_for_fds(file_descriptors_to_leave_open)
- # At this point, RubyGems might have open file handles for which
- # the associated file descriptors have just been closed. This can
- # result in mysterious 'EBADFD' errors. So we force RubyGems to
- # clear all open file handles.
- Gem.clear_paths
-
# Reseed pseudo-random number generator for security reasons.
srand
diff --git a/passenger/lib/phusion_passenger/classic_rails/application_spawner.rb b/passenger/lib/phusion_passenger/classic_rails/application_spawner.rb
index 52b2ab1..27206a4 100644
--- a/passenger/lib/phusion_passenger/classic_rails/application_spawner.rb
+++ b/passenger/lib/phusion_passenger/classic_rails/application_spawner.rb
@@ -21,7 +21,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
-require 'rubygems'
require 'socket'
require 'etc'
require 'fcntl'
diff --git a/passenger/lib/phusion_passenger/classic_rails/framework_spawner.rb b/passenger/lib/phusion_passenger/classic_rails/framework_spawner.rb
index b4e447b..29d43c5 100644
--- a/passenger/lib/phusion_passenger/classic_rails/framework_spawner.rb
+++ b/passenger/lib/phusion_passenger/classic_rails/framework_spawner.rb
@@ -21,7 +21,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
-require 'rubygems'
require 'phusion_passenger/abstract_server'
require 'phusion_passenger/abstract_server_collection'
require 'phusion_passenger/app_process'
@@ -271,13 +270,6 @@ private
rescue InvalidPath, AppInitError, ApplicationSpawner::Error => e
client.write('exception')
client.write_scalar(marshal_exception(e))
- if e.respond_to?(:child_exception) && e.child_exception.is_a?(LoadError)
- # A source file failed to load, maybe because of a
- # missing gem. If that's the case then the sysadmin
- # will install probably the gem. So we clear RubyGems's
- # cache so that it can detect new gems.
- Gem.clear_paths
- end
return
end
begin
diff --git a/passenger/lib/phusion_passenger/dependencies.rb b/passenger/lib/phusion_passenger/dependencies.rb
index 9f2f43d..6883de0 100644
--- a/passenger/lib/phusion_passenger/dependencies.rb
+++ b/passenger/lib/phusion_passenger/dependencies.rb
@@ -235,7 +235,9 @@ module Dependencies # :nodoc: all
end
if RUBY_PLATFORM =~ /linux/
tags = PlatformInfo.linux_distro_tags
- if tags.include?(:debian)
+ if tags.include?(:alt)
+ dep.install_command = "apt-get install ruby-devel"
+ elsif tags.include?(:debian)
dep.install_command = "apt-get install ruby1.8-dev"
elsif tags.include?(:mandriva)
dep.install_command = "urpmi urpmi ruby-RubyGems"
@@ -274,21 +276,6 @@ module Dependencies # :nodoc: all
end
end
- RubyGems = Dependency.new do |dep|
- dep.name = "RubyGems"
- dep.define_checker do |result|
- begin
- require 'rubygems'
- result.found
- rescue LoadError
- result.not_found
- end
- end
- dep.website = "http://www.rubygems.org/"
- dep.install_instructions = "Please download it from #{dep.website}. " <<
- "Extract the tarball, and run ruby setup.rb"
- end
-
Rake = Dependency.new do |dep|
dep.name = "Rake"
dep.define_checker do |result|
@@ -419,10 +406,6 @@ module Dependencies # :nodoc: all
dep.name = "fastthread"
dep.define_checker do |result|
begin
- begin
- require 'rubygems'
- rescue LoadError
- end
require 'fastthread'
result.found
rescue LoadError
@@ -436,10 +419,6 @@ module Dependencies # :nodoc: all
dep.name = "rack"
dep.define_checker do |result|
begin
- begin
- require 'rubygems'
- rescue LoadError
- end
require 'rack'
result.found
rescue LoadError
@@ -565,10 +544,6 @@ module Dependencies # :nodoc: all
dep.name = "file-tail"
dep.define_checker do |result|
begin
- begin
- require 'rubygems'
- rescue LoadError
- end
require 'file/tail'
result.found
rescue LoadError
@@ -584,10 +559,6 @@ module Dependencies # :nodoc: all
"#{PlatformInfo.gem_command || "gem"} install daemon_controller"
dep.define_checker do |result|
begin
- begin
- require 'rubygems'
- rescue LoadError
- end
require 'daemon_controller'
begin
require 'daemon_controller/version'
diff --git a/passenger/lib/phusion_passenger/platform_info/ruby.rb b/passenger/lib/phusion_passenger/platform_info/ruby.rb
index 2042b69..d080cbb 100644
--- a/passenger/lib/phusion_passenger/platform_info/ruby.rb
+++ b/passenger/lib/phusion_passenger/platform_info/ruby.rb
@@ -274,15 +274,7 @@ private
end
if !File.file?(filename) || !File.executable?(filename)
- # RubyGems might put binaries in a directory other
- # than Ruby's bindir. Debian packaged RubyGems and
- # DebGem packaged RubyGems are the prime examples.
- begin
- require 'rubygems' unless defined?(Gem)
- filename = Gem.bindir + "/#{name}"
- rescue LoadError
- filename = nil
- end
+ filename = nil
end
if !filename || !File.file?(filename) || !File.executable?(filename)
diff --git a/passenger/lib/phusion_passenger/standalone/runtime_installer.rb b/passenger/lib/phusion_passenger/standalone/runtime_installer.rb
index 98b9070..e9bff76 100644
--- a/passenger/lib/phusion_passenger/standalone/runtime_installer.rb
+++ b/passenger/lib/phusion_passenger/standalone/runtime_installer.rb
@@ -80,7 +80,6 @@ protected
Dependencies::DownloadTool,
Dependencies::Ruby_DevHeaders,
Dependencies::Ruby_OpenSSL,
- Dependencies::RubyGems,
Dependencies::Rake,
Dependencies::Rack,
Dependencies::Curl_Dev,
diff --git a/passenger/lib/phusion_passenger/utils.rb b/passenger/lib/phusion_passenger/utils.rb
index 13e6133..93184f0 100644
--- a/passenger/lib/phusion_passenger/utils.rb
+++ b/passenger/lib/phusion_passenger/utils.rb
@@ -22,7 +22,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
-require 'rubygems'
require 'thread'
if (!defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby") && RUBY_VERSION < "1.8.7"
require 'fastthread'
@@ -241,11 +240,6 @@ protected
require 'phusion_passenger/analytics_logger'
options["analytics_logger"] = AnalyticsLogger.new_from_options(options)
- # Make sure RubyGems uses any new environment variable values
- # that have been set now (e.g. $HOME, $GEM_HOME, etc) and that
- # it is able to detect newly installed gems.
- Gem.clear_paths
-
# Because spawned app processes exit using #exit!, #at_exit
# blocks aren't called. Here we ninja patch Kernel so that
# we can call #at_exit blocks during app process shutdown.
@@ -312,34 +306,8 @@ protected
# 2. Bundler *is* used, but the gems are not locked and we're supposed
# to call Bundler.setup.
#
- # The existence of Gemfile indicates whether (2) is true:
- elsif File.exist?('Gemfile')
- # In case of Rails 3, config/boot.rb already calls Bundler.setup.
- # However older versions of Rails may not so loading boot.rb might
- # not be the correct thing to do. To be on the safe side we
- # call Bundler.setup ourselves; calling Bundler.setup twice is
- # harmless. If this isn't the correct thing to do after all then
- # there's always the load_path_setup_file option and
- # setup_load_paths.rb.
- require 'rubygems'
- require 'bundler'
- Bundler.setup
- end
-
- # Bundler might remove Phusion Passenger from the load path in its zealous
- # attempt to un-require RubyGems, so here we put Phusion Passenger back
- # into the load path. This must be done before loading the app's startup
- # file because the app might require() Phusion Passenger files.
- if $LOAD_PATH.first != LIBDIR
- $LOAD_PATH.unshift(LIBDIR)
- $LOAD_PATH.uniq!
end
-
- # !!! NOTE !!!
- # If the app is using Bundler then any dependencies required past this
- # point must be specified in the Gemfile. Like ruby-debug if debugging is on...
-
if options["debugger"]
require 'ruby-debug'
if !Debugger.respond_to?(:ctrl_port)
diff --git a/passenger/test/support/multipart.rb b/passenger/test/support/multipart.rb
index 48e6db2..3af2806 100644
--- a/passenger/test/support/multipart.rb
+++ b/passenger/test/support/multipart.rb
@@ -8,7 +8,6 @@ module Multipart
##(bill@marginalia.org)
### NOW:
## Everything wrong is due to keith@oreilly.com
- require 'rubygems'
require 'mime/types'
require 'net/http'
require 'cgi'