El Tuesday 11 November 2014, gvim escribi:
> I would like to be able to upgrade Ruby minor versions without
> reinstalling all my gems but haven't had much luck so far. Eventually I
> stopped using rbenv and installed Ruby 2.1 from source using $GEM_HOME
> as my gem location. This worked up to 2.1.2 but, for some reason I still
> haven't fathomed, 2.1.3 and 2.1.4 would not install (OS X 10.8). Is
> there any way of making rbenv work with GEM_HOME instead of creating a
> new gems folder for every minor Ruby version?

I started with Ruby from the system. Added GEM_HOME to the mix, because I want 
a clean separation of what gems I install as a user and what the system (the 
package manager of my Linux distribution) is aware of.

Then I added rbenv to the mix, and I found out that switching ruby's with 
rbenv was nice. The problem is that the gems were always installed on GEM_HOME 
(of course), but not in all cases were compatible. I had trouble with one that 
uses native code, IIRC. I explored a bit what rbenv was capable of, and what 
the extensions could do, but I think is not there yet. This pull request hints 
in the right direction, but is not there yet:

https://github.com/sstephenson/rbenv/pull/639

My solution was to ditch rbenv for now, since I just wanted 2 Ruby versions: 
the one from the system, and a more recent one. The build is trivial. I 
configured with --prefix=$HOME/local/ruby-x.y.z and done. When I need the 
locally installed, I unset GEM_HOME (gems will be installed to 
$HOME/local/ruby-x.y.z/lib/ruby/gems/, which is fine for me), and either use 
the full path, or I fix the PATH so the version in ~/local has precedence).

-- 
Alex (a.k.a. suy) | GPG ID 0x0B8B0BC2
http://barnacity.net/ | http://disperso.net