brasslock / rubyripper

Automatically exported from code.google.com/p/rubyripper
1 stars 0 forks source link

require 'gtk2' will raise an unrescued exception if $DISPLAY is not set. #514

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

I am packaging rubyripper for Debian, and packages are built in a 'fakeroot' 
environment which has most environment variables scrubbed. The rubyripper 
configure script only rescues from LoadError when trying to require 'gtk2'. 
However if the environment variable DISPLAY is not set, require 'gtk2' will 
raise another exception. This can be reproduced by the following commands:

$ env -u DISPLAY irb
irb(main):001:0> require 'gtk2'
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': iconv will be 
deprecated in the future, use String#encode instead.
/usr/lib/ruby/1.9.1/gettext/runtime/locale_path.rb:20: Use RbConfig instead of 
obsolete and deprecated Config.
Gtk::InitError: Cannot open display:  
        from /usr/lib/ruby/vendor_ruby/gtk2.rb:13:in `init'
        from /usr/lib/ruby/vendor_ruby/gtk2.rb:13:in `<top (required)>'
        from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from (irb):1
        from /usr/bin/irb:12:in `<main>'

What is the expected output? What do you see instead?

I expect that the configure script should rescue any exception other than 
LoadError and continue, since any other exception indicates that the gem is 
available even if it isn't loading successfully in the configure environment.

Regards,
Scott.

Original issue reported on code.google.com by sc...@sl.id.au on 12 Mar 2012 at 10:17

GoogleCodeExporter commented 9 years ago
This is fixed in master and stable branch, thanks for the report.

Original comment by boukewou...@gmail.com on 31 Jul 2012 at 7:26