Bug #4345

IRB fails with --disable-gems and Ubuntu default LANG variable

Added by Luis Lavena almost 5 years ago. Updated over 4 years ago.

Assignee:Yuki Sonoda
ruby -v:ruby 1.9.3dev (2011-01-30 trunk 30724) [i686-linux] Backport:



$ echo $LANG

$ ruby -v
ruby 1.9.3dev (2011-01-30 trunk 30724) [i686-linux]

$ ruby --disable-gems -S irb
/home/user/sandbox/ruby-trunk/lib/ruby/1.9.1/irb/locale.rb:150:in block in search_file': uninitialized constant IRB::Locale::Gem (NameError)
from /home/user/sandbox/ruby-trunk/lib/ruby/1.9.1/irb/locale.rb:158:in
block in each_localized_path'
from /home/user/sandbox/ruby-trunk/lib/ruby/1.9.1/irb/locale.rb:167:in each_sublocale'
from /home/user/sandbox/ruby-trunk/lib/ruby/1.9.1/irb/locale.rb:157:in
from /home/user/sandbox/ruby-trunk/lib/ruby/1.9.1/irb/locale.rb:145:in search_file'
from /home/user/sandbox/ruby-trunk/lib/ruby/1.9.1/irb/locale.rb:124:in
from /home/user/sandbox/ruby-trunk/lib/ruby/1.9.1/irb/locale.rb:108:in load'
from /home/user/sandbox/ruby-trunk/lib/ruby/1.9.1/irb/locale.rb:32:in
from /home/user/sandbox/ruby-trunk/lib/ruby/1.9.1/irb/init.rb:114:in new'
from /home/user/sandbox/ruby-trunk/lib/ruby/1.9.1/irb/init.rb:114:in
from /home/user/sandbox/ruby-trunk/lib/ruby/1.9.1/irb/init.rb:16:in setup'
from /home/user/sandbox/ruby-trunk/lib/ruby/1.9.1/irb.rb:53:in
from /home/user/sandbox/ruby-trunk/bin/irb:12:in `'

If no disable-gems were present, IRB works.

unset LANG make IRB works even with --disable-gems

$ ruby --disable-gems -S irb
irb(main):001:0> exit



#1 Updated by Charles Nutter almost 5 years ago

IRB's localization support appears to try using RubyGems to load the localized file?

This was the commit that added it. Does not appear to exist in 1.9.2:

commit 09aefc43a54bff5c27c856de71af4d18e9223d59
Author: yugui yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Date: Wed Jan 5 01:13:12 2011 +0000

 * lib/irb/locale.rb (IRB::Locale#search_file): make it possible
   to load a localization from a gem.
   (IRB::Locale#lc_path): obsoleted because of the change of #search_file
   (IRB::Locale#each_localized_path): new private method, based on lc_path
   (IRB::Locale#find): follows the change of #search_file.
   (IRB::Locale#load): removed duplicate with #find.

 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e


#2 Updated by Yuki Sonoda almost 5 years ago

  • Assignee set to Yuki Sonoda



#3 Updated by Yuki Sonoda almost 5 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r30741.
Luis, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

  • lib/irb/locale.rb (IRB::Locale::#search_file): Gem might be undefined if --disable-gems. =end

Also available in: Atom PDF