From 37268d0526036fcd29a319932f734a53ee35ae34 Mon Sep 17 00:00:00 2001
From: DJ Mountney <david@twkie.net>
Date: Tue, 7 Mar 2017 09:22:04 -0800
Subject: [PATCH] Fix for using gem build/install

When pre-compiled assets are missing for the current platform, and you run gem install, the compiled native extensions are placed in the first require paths folder. This differs from rake-compiler task, where they are always placed in lib.

Setting the lib path as the first require path will ensure the compiled library is placed in the correct folder.
---
 grpc.gemspec                    | 2 +-
 templates/grpc.gemspec.template | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/grpc.gemspec b/grpc.gemspec
index 8d5b7b2ab1..1d2ee0725a 100755
--- a/grpc.gemspec
+++ b/grpc.gemspec
@@ -24,7 +24,7 @@ Gem::Specification.new do |s|
   s.files += Dir.glob('include/grpc/**/*')
   s.test_files = Dir.glob('src/ruby/spec/**/*')
   s.bindir = 'src/ruby/bin'
-  s.require_paths = %w( src/ruby/bin src/ruby/lib src/ruby/pb )
+  s.require_paths = %w( src/ruby/lib src/ruby/bin src/ruby/pb )
   s.platform      = Gem::Platform::RUBY
 
   s.add_dependency 'google-protobuf', '~> 3.1'
diff --git a/templates/grpc.gemspec.template b/templates/grpc.gemspec.template
index 462ea52614..80ce643d80 100644
--- a/templates/grpc.gemspec.template
+++ b/templates/grpc.gemspec.template
@@ -26,7 +26,7 @@
     s.files += Dir.glob('include/grpc/**/*')
     s.test_files = Dir.glob('src/ruby/spec/**/*')
     s.bindir = 'src/ruby/bin'
-    s.require_paths = %w( src/ruby/bin src/ruby/lib src/ruby/pb )
+    s.require_paths = %w( src/ruby/lib src/ruby/bin src/ruby/pb )
     s.platform      = Gem::Platform::RUBY
 
     s.add_dependency 'google-protobuf', '~> 3.1'
-- 
GitLab