Skip to content
Snippets Groups Projects
Commit 701951f6 authored by Nicolas Noble's avatar Nicolas Noble Committed by GitHub
Browse files

Merge pull request #7800 from apolcyn/dont_catch_load_error

Dont catch load error when loading grpc lib in ruby gem
parents bbc20b59 e61aab26
No related branches found
No related tags found
No related merge requests found
......@@ -28,7 +28,12 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
begin
require_relative "#{RUBY_VERSION.sub(/\.\d$/, '')}/grpc_c"
rescue LoadError
require_relative 'grpc_c'
ruby_version_dirname = /(\d+\.\d+)/.match(RUBY_VERSION).to_s
distrib_lib_dir = File.expand_path(ruby_version_dirname,
File.dirname(__FILE__))
if File.directory?(distrib_lib_dir)
require_relative "#{distrib_lib_dir}/grpc_c"
else
require_relative 'grpc_c'
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment