Opened 17 years ago

Closed 17 years ago

Last modified 16 years ago

#14179 closed defect (invalid)

gtk2: cannot open display: (RuntimeError)

Reported by: gjznituv@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 1.6.0
Keywords: Cc:
Port:

Description

After installing gtk2 for ruby (rb-gnome), I'm trying to run a script that tries to open the display - e.g. rsqlitegui.rb (http://rsqlitegui.rubyforge.org/) or simply run:

[~] ruby -e "require 'gtk2'"

I then get the same error every time:

/opt/local/lib/ruby/vendor_ruby/1.8/gtk2.rb:13:in `init': cannot open display:  (RuntimeError)

Change History (7)

comment:1 Changed 17 years ago by jmpalacios (Juan Manuel Palacios)

Milestone: Port Bugs

comment:2 Changed 17 years ago by skymoo (Adam Mercer)

What platform is this on?

If it's Leopard have you installed the X11 update from http://xquartz.macosforge.org? Also what is your $DISPLAY variable set to? It should be of the form /tmp/launch-rgfV7K/:0 on Leopard.

comment:3 Changed 17 years ago by gjznituv@…

I'm on Leopard, 10.5.1.

I haven't installed the X11 update. Should I? Or is that something that breaks gtk2?

My $DISPLAY may have gone awry:

[~] echo $DISPLAY
:0.0
[~] /tmp/launch
launch-1kcZ0I/       launch-Zf7Gla/       launchd-213.s2eVAU/  launchd-59.kte9k3/   
launch-5QOTXc/       launchd-129.Duln8W/  launchd-216.PGV2fl/  launchd-6782.JEBM94/ 

What should I do about it?

comment:4 Changed 17 years ago by skymoo (Adam Mercer)

There's a bug in Leopard's libX11 that causes it to crash on most gtk apps so I'd definitely advise installing the update.

Regarding $DISPLAY: you're setting $DISPLAY somewhere in your setup scripts and need to remove it, running the following should indicate where:

$ grep DISPLAY ~/.*rc ~/.login ~/.*profile ~/.MacOSX/ environment.plist 2>/dev/null

comment:5 Changed 17 years ago by gjznituv@…

Thanks.

"export DISPLAY=:0.0" somehow found its way into my .profile, not sure how.

I removed it and it works now.

comment:6 Changed 17 years ago by raimue (Rainer Müller)

Resolution: invalid
Status: newclosed

comment:7 Changed 16 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

Note: See TracTickets for help on using tickets.