Created attachment 155150 [details] add config option to cleanup gem functions completely In ports, ruby components of gem is installed by devel/ruby-gems ports, but lang/ruby?? has their components too, it is source of trouble. This patch add config option to cleanup gem functions completely.
Created attachment 155506 [details] patch to fully remove gem from ruby and add ri docs to gem Thought this shouldn't be optional, so here's an updated patch which removes it completely. Also made some minor cleanups while here, including adding the ri docs to devel/ruby-gems. So far this breaks a few things, so I'm going to work on cleaning those up before committing. In the mean time, please test.
I've tested new patch with ruby22 in my FreeBSD 10.1-RELEASE-p6, it works well.
(In reply to ksmakoto from comment #2) Thanks for the testing. I've been testing too and found that it breaks a number of ports. Some, such as devel/rubygem-glib2 and devel/rubygem-gio2 just need to have: require "rubygems" added in certain places. Others, such as databases/ruby-bdb break because they call rdoc and rdoc requires gem. I can patch out the requirement of gem in rdoc, but I can't be sure it will work properly. Upstream, ruby, rdoc and gem are all distributed together and it makes sense for them to depend on each other. So I'm a bit hesitant to go changing things too much. This all makes me unsure that removing the gem bits from ruby is the right thing to do. Can you explain in more detail the original issues that you encountered? What is the trouble you have when gem is included with ruby? (Not saying it's not real, just want to understand all sides of the issue before making a decision which way to go.)
Created attachment 155553 [details] fully remove gem from ruby, add ri docs to gem and fix ports broken by change Here's an updated patch which fixes some of the issues caused by the change. Still would like more detail on the original issue before I decide if this is the right way forward.
Forgot to mention that patch has some other cleanups as well.
A few days ago, I installed rubygems in $HOME/.gem/lib (without ruby-gems ports), and something went wrong. It looks that the environment var RUBYOPT=-I$HOME/.gem/lib does not working well. I was deleted rubygems in /usr/local/lib/ruby/2.2 (and --disable=gems option), it looks working well. Just now, I try to reproduce it, but RUBYOPT=-I$HOME/.gem/lib looks working correctly, sorry. If deletion seems overdone, be --disable-rubygems configure arg only, and/or make this optional, how is this?
Also it should be noted that irb calls Gem: https://github.com/ruby/ruby/blob/11b97855c4c1ef756fa1546ff0137aad1a910f34/lib/irb/locale.rb#L149 So I'm really not sure about this. It would seem cleaner to completely remove gem and makes updates to gem easier. But this seems to break irb and is unexpected to many. I think our current situation may be the best compromise. Perhaps if we keep moving ruby forward and gem doesn't change as much it would make sense to install gem with ruby.
Closing this as I've decided it's not a good change or direction.