Skip to content

Commit

Permalink
OHAI-140: Make loading rubygems optional, but if the subsequent libra…
Browse files Browse the repository at this point in the history
…ry fails to

load we drop a hint as to the possible cause, then pass the original exception.
  • Loading branch information
mdkent committed Oct 30, 2009
1 parent 4d0030f commit 0062e57
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion bin/ohai
Expand Up @@ -20,5 +20,19 @@
#

$: << File.join(File.dirname(__FILE__), "..", "lib")
require 'ohai/application'
begin
require 'rubygems'
rescue LoadError
# must be debian! ;)
missing_rubygems = true
end
begin
require 'ohai/application'
rescue LoadError
if missing_rubygems
STDERR.puts "rubygems previously failed to load - is it installed?"
end

raise
end
Ohai::Application.new.run

0 comments on commit 0062e57

Please sign in to comment.