--- /home/vagrant/ruby-2.5.0/tool/rbinstall.rb	2017-10-30 05:45:20.000000000 +0000
+++ src/tool/rbinstall.rb	2018-02-14 18:53:42.498522407 +0000
@@ -731,7 +731,7 @@
 end
 
 def install_default_gem(dir, srcdir)
-  gem_dir = Gem.default_dir
+  gem_dir = "@TERMUX_PREFIX@/lib/ruby/gems/2.7.0"
   directories = Gem.ensure_gem_subdirectories(gem_dir, :mode => $dir_mode)
   prepare "default gems from #{dir}", gem_dir, directories
 
@@ -765,7 +765,7 @@
 end
 
 install?(:ext, :comm, :gem, :'bundled-gems') do
-  gem_dir = Gem.default_dir
+  gem_dir = "@TERMUX_PREFIX@/lib/ruby/gems/2.7.0"
   directories = Gem.ensure_gem_subdirectories(gem_dir, :mode => $dir_mode)
   prepare "bundled gems", gem_dir, directories
   install_dir = with_destdir(gem_dir)
