ALT Linux Sisyphus discussions
 help / color / mirror / Atom feed
From: "Мал Скрылёв" <3ahyga@gmail.com>
To: ALT Linux Sisyphus discussions <sisyphus@lists.altlinux.org>
Subject: Re: [sisyphus] gem, ruby deps и passenger
Date: Mon, 28 Feb 2011 10:08:26 +0300
Message-ID: <AANLkTimTVOJ_PZsLxGGwFHECEMDN3y5F9Un4ikVtNRve@mail.gmail.com> (raw)
In-Reply-To: <AANLkTindQs9j0JwUzJnC12vvWFyhZijdUxHHHHR3fQ5N@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1664 bytes --]

27 февраля 2011 г. 4:48 пользователь Igor Zubkov
<igor.zubkov@gmail.com> написал:
> 2011/2/26 Мал Скрылёв:
>> Приветствую,
>>
>> при сборке некоего ruby-пакета вываливается ошибка:
>>
>> ruby.req.rb: forbidden dependency: rubygems
>> find-requires: ERROR: /usr/lib/rpm/ruby.req failed
>> ошибка: /bin/sh не удалось
>> ошибка: Невозможно найти Requires
>>
>>
>> Ошибки сборки пакетов:
>>    /bin/sh не удалось
>>    Невозможно найти Requires
>>
>> Насколько я понимаю это из-за того, что gems запрещён к зависимостям,
>> так вот, по вычистке дерева пакета от gem-а, проблема остаётся таже.
>> Прицепляю лог сборки, там видно что, никаких упоминания о gems нету
>> уже (кроме имени патча) и всё равно оно
>> говорит, что зависит от gems. Что сие может быть? spec тоже прицепляю.
>
> Патч выложите. А то воспроизводить не на чем.
>
Извиняюсь, прицепил.

> P.S.: А сами rubygems стоят? И если стоят, если удалить так же?
>
> --
> Igor Zubkov
> http://hi.im/ice
> _______________________________________________
> Sisyphus mailing list
> Sisyphus@lists.altlinux.org
> https://lists.altlinux.org/mailman/listinfo/sisyphus



-- 
Малъ Зануда, Скрылёвъ сынъ

[-- Attachment #2: passenger-3.0.2-remove-gem-dependency.patch --]
[-- Type: text/x-patch, Size: 10871 bytes --]

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 <b>#{dep.website}</b>. " <<
-			"Extract the tarball, and run <b>ruby setup.rb</b>"
-	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
 			"<b>#{PlatformInfo.gem_command || "gem"} install daemon_controller</b>"
 		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'

  parent reply	other threads:[~2011-02-28  7:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-26 11:39 Мал Скрылёв
2011-02-27  1:48 ` Igor Zubkov
2011-02-28  7:07   ` Мал Скрылёв
2011-02-28  7:08   ` Мал Скрылёв [this message]
2011-03-01 14:55     ` Igor Zubkov
2011-03-02  7:05       ` Мал Скрылёв
2011-03-02 15:34         ` Igor Zubkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTimTVOJ_PZsLxGGwFHECEMDN3y5F9Un4ikVtNRve@mail.gmail.com \
    --to=3ahyga@gmail.com \
    --cc=sisyphus@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Sisyphus discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/sisyphus/0 sisyphus/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 sisyphus sisyphus/ http://lore.altlinux.org/sisyphus \
		sisyphus@altlinux.ru sisyphus@altlinux.org sisyphus@lists.altlinux.org sisyphus@lists.altlinux.ru sisyphus@lists.altlinux.com sisyphus@linuxteam.iplabs.ru sisyphus@list.linux-os.ru
	public-inbox-index sisyphus

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.sisyphus


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git