Skip to content

Commit

Permalink
(puppetlabs#9174) Provide a helpful error when missing a gem and inst…
Browse files Browse the repository at this point in the history
…alling on Windows

We require the sys-admin, win32-process, win32-dir, and win32-service
gems in order to run on Windows, and the win32-dir gem to install.
Previously, failing to require the win32-dir gem would just raise an
exception and fail. Now we catch it, and turn it into a more helpful
explanation of the requirements.
  • Loading branch information
nicklewis committed Aug 25, 2011
1 parent a2ced0f commit 4274e15
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,12 @@ def prepare_installation
if not InstallOptions.configdir.nil?
configdir = InstallOptions.configdir
elsif $operatingsystem == "windows"
require 'win32/dir'
begin
require 'win32/dir'
rescue LoadError => e
puts "Cannot run on Microsoft Windows without the sys-admin, win32-process, win32-dir & win32-service gems: #{e}"
exit -1
end
configdir = File.join(Dir::COMMON_APPDATA, "PuppetLabs", "puppet", "etc")
else
configdir = "/etc/puppet"
Expand Down

0 comments on commit 4274e15

Please sign in to comment.