Permalink
Browse files

detect when net/https is not available and suggest installing libopen…

…ssl-ruby
  • Loading branch information...
1 parent 6935bb9 commit 742bc77a842dbf7f0de7826046ff38dfaab0633b @pedro pedro committed Jun 24, 2009
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/restclient.rb
View
@@ -1,8 +1,14 @@
require 'uri'
-require 'net/https'
require 'zlib'
require 'stringio'
+begin
+ require 'net/https'
+rescue LoadError => e
+ raise e unless RUBY_PLATFORM =~ /linux/
+ raise LoadError, "no such file to load -- net/https. Try running apt-get install libopenssl-ruby"
+end
+
require File.dirname(__FILE__) + '/restclient/request'
require File.dirname(__FILE__) + '/restclient/mixin/response'
require File.dirname(__FILE__) + '/restclient/response'

0 comments on commit 742bc77

Please sign in to comment.