Skip to content

Instantly share code, notes, and snippets.

  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save myabc/73553 to your computer and use it in GitHub Desktop.
From 05721dde8a1adfe34f091560a2e2bef54d2fe65e Mon Sep 17 00:00:00 2001
From: Alex Coles <alex@alexcolesportfolio.com>
Date: Tue, 3 Mar 2009 22:57:10 +0100
Subject: [PATCH] Ensure rake install command uses same Ruby interpreter/implementation
Signed-off-by: Alex Coles <alex@alexcolesportfolio.com>
---
tasks/install.rb | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/tasks/install.rb b/tasks/install.rb
index 24ca864..c16baef 100644
--- a/tasks/install.rb
+++ b/tasks/install.rb
@@ -1,6 +1,10 @@
WIN32 = (RUBY_PLATFORM =~ /win32|mingw|bccwin|cygwin/) rescue nil
SUDO = WIN32 ? '' : ('sudo' unless ENV['SUDOLESS'])
+def sudo_gem(cmd)
+ sh "#{SUDO} #{RUBY} -S gem #{cmd}", :verbose => false
+end
+
desc "Install #{GEM_NAME}"
if WIN32
task :install => :gem do
@@ -15,6 +19,6 @@ if WIN32
end
else
task :install => :package do
- sh %{#{SUDO} gem install --local pkg/#{GEM_NAME}-#{GEM_VERSION}.gem}
+ sudo_gem %{install --local pkg/#{GEM_NAME}-#{GEM_VERSION}.gem}
end
end
--
1.6.1.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment