Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the right way to install gems in a GC Patched ruby?

I want to install a GC Patched Ruby to do a memory profiling on my app. I followed the instructions at http://guides.rubyonrails.org/performance_testing.html#gc and installed a ruby instance at my home dir (I already have another "official" instance for development). This GC Patched ruby instance is working fine.

The problem is when I need to install gems to this instance, as the step 1.8.6 from the guide above tell me to do. I can't use the install of rubygems already on my machine, because it is pointing to other ruby instance. And I wasn't able to install another instance of rubygems just to my gc patched ruby.

That's why I want to know the right way to install rubygems on a GC patched ruby, in a machine that already have another install of non patched ruby.

like image 437
Cipriani Avatar asked Dec 20 '25 09:12

Cipriani


1 Answers

You need to set your GEM_HOME and GEM_PATH environment variables to point to the directory you would like ruby to pull the gems from.

Also make sure the patched ruby binary appears before the other version in your PATH environment variable to ensure its picking up the correct version.

like image 175
Lolindrath Avatar answered Dec 23 '25 02:12

Lolindrath



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!