https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112016-01-07T03:13:50ZRuby Issue Tracking SystemRuby master - Bug #11956: RUBYOPT parses after rubygems loadedhttps://redmine.ruby-lang.org/issues/11956?journal_id=559902016-01-07T03:13:50Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Feedback</i></li></ul><p>Yes.</p>
<p>And what is your problem?</p> Ruby master - Bug #11956: RUBYOPT parses after rubygems loadedhttps://redmine.ruby-lang.org/issues/11956?journal_id=560012016-01-07T08:33:44Zpersonnel (Am I Who)x@pbl.pw
<ul></ul><p>Nobuyoshi Nakada wrote:</p>
<blockquote>
<p>Yes.</p>
<p>And what is your problem?</p>
</blockquote>
<p>I change GEM_HOME and GEM_PATH in loader.rb , but it doesn't affect Gem.path.<br>
The same loader.rb works at ruby 2.2.3(and before) and jruby.<br>
I uses both MRI ruby and jruby,so I uses RUBYOPT to changes GEM_HOME and GEM_PATH for different ruby engine</p> Ruby master - Bug #11956: RUBYOPT parses after rubygems loadedhttps://redmine.ruby-lang.org/issues/11956?journal_id=560022016-01-07T08:45:10Zpersonnel (Am I Who)x@pbl.pw
<ul><li><strong>Description</strong> updated (<a title="View differences" href="/journals/56002/diff?detail_id=39959">diff</a>)</li></ul> Ruby master - Bug #11956: RUBYOPT parses after rubygems loadedhttps://redmine.ruby-lang.org/issues/11956?journal_id=560202016-01-08T13:07:32Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul></ul><p>Rubygems sets <code>Gem.path</code> at loading the first gem.<br>
Ruby 2.3 bundles <code>did_you_mean</code> and activates it by default.<br>
Why don't you set <code>GEM_HOME</code> and <code>GEM_PATH</code> directly instead of setting them in that file?</p> Ruby master - Bug #11956: RUBYOPT parses after rubygems loadedhttps://redmine.ruby-lang.org/issues/11956?journal_id=560232016-01-09T00:15:28Zpersonnel (Am I Who)x@pbl.pw
<ul></ul><p>Nobuyoshi Nakada wrote:</p>
<blockquote>
<p>Rubygems sets <code>Gem.path</code> at loading the first gem.<br>
Ruby 2.3 bundles <code>did_you_mean</code> and activates it by default.<br>
Why don't you set <code>GEM_HOME</code> and <code>GEM_PATH</code> directly instead of setting them in that file?</p>
</blockquote>
<p>Because I uses MRI ruby and jruby at the same time, if I just set env variable GEM_HOME and GEM_PATH many gems will conflict within MRI ruby and jruby</p> Ruby master - Bug #11956: RUBYOPT parses after rubygems loadedhttps://redmine.ruby-lang.org/issues/11956?journal_id=560242016-01-09T01:52:04Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul></ul><p>I'm uncertain if rubygems expects such usage of <code>RUBYOPT</code> or not.</p>
<p>Another way is to put your code in <code>rubygems/defaults/ruby.rb</code> under <code>RUBYLIB</code>.<br>
This file is read only when <code>RUBY_ENGINE</code> is <code>"ruby"</code> at initialization of rubygems.</p> Ruby master - Bug #11956: RUBYOPT parses after rubygems loadedhttps://redmine.ruby-lang.org/issues/11956?journal_id=560262016-01-09T05:04:07Zpersonnel (Am I Who)x@pbl.pw
<ul></ul><p>Nobuyoshi Nakada wrote:</p>
<blockquote>
<p>I'm uncertain if rubygems expects such usage of <code>RUBYOPT</code> or not.</p>
<p>Another way is to put your code in <code>rubygems/defaults/ruby.rb</code> under <code>RUBYLIB</code>.<br>
This file is read only when <code>RUBY_ENGINE</code> is <code>"ruby"</code> at initialization of rubygems.</p>
</blockquote>
<p>RUBYOPT parse prior to rubygems before ruby 2.3.0, why ruby 2.3.0 change this?</p> Ruby master - Bug #11956: RUBYOPT parses after rubygems loadedhttps://redmine.ruby-lang.org/issues/11956?journal_id=560302016-01-09T09:39:34Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul></ul><p>Am I Who wrote:</p>
<blockquote>
<p>RUBYOPT parse prior to rubygems before ruby 2.3.0, why ruby 2.3.0 change this?</p>
</blockquote>
<p>I have explained: <a href="https://bugs.ruby-lang.org/issues/11956#note-4" class="external">https://bugs.ruby-lang.org/issues/11956#note-4</a></p>
<blockquote>
<p>Rubygems sets <code>Gem.path</code> at loading the first gem.<br>
Ruby 2.3 bundles <code>did_you_mean</code> and activates it by default.</p>
</blockquote>
<p>It hasn't changed, just a gem is loaded before <code>RUBYOPT</code>.</p>
<p>Another way is to set <code>Gem.paths</code> in that script, instead of setting the environment variables.</p> Ruby master - Bug #11956: RUBYOPT parses after rubygems loadedhttps://redmine.ruby-lang.org/issues/11956?journal_id=799502019-07-24T15:18:38Zjeremyevans0 (Jeremy Evans)merch-redmine@jeremyevans.net
<ul><li><strong>Status</strong> changed from <i>Feedback</i> to <i>Closed</i></li></ul>