Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
GoogleCodeExporter opened this issue Jan 18, 2016 · 1 comment

Comments

@GoogleCodeExporter
Copy link

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
Copy link
Author

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

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant