ashbb / green_shoes

Green Shoes is one of the colorful Shoes written in pure Ruby.
Other
204 stars 37 forks source link

Green Shoes fails Mac #59

Open facetoe opened 12 years ago

facetoe commented 12 years ago

Hello, I just tried installing green_shoes using the instructions on the github site. I managed to install all the dependencies and everything with homebrew, then the green_shoes gem, but whenever I try and run something simple like:

Shoes.app do para 'Hello World' end

I get this massive error - http://pastie.org/3230151

Has anyone had this problem or have any ideas what I could do?

I'm using a Macbook with Lion, Xcode 4.1 and ruby 1.9.2 with rvm.

Any help would be greatly appreciated.

ashbb commented 12 years ago

Hi facetoe,

Thank you for trying Green Shoes.

I looked at both http://pastie.org/3230151 and http://pastie.org/3234189

But sorry, I don't have a Mac, so I can't recreate your problem. :(

The error occured in show_pango_layout method in both cases. Could you confirm the following two test snippets?

 # test1
 require 'green_shoes'
 Shoes.app{}

 # test2
 require 'green_shoes'
 Shoes.app{oval 100, 100, 100}

If the above two works well, it may be Pango's problem on Mac.

ashbb

facetoe commented 12 years ago

Hey asshbb, thanks for the quick response.

I tried both your tests and the first one works fine. It throws up an empty X11 window.

When I tried the second test immediately after, it did nothing. I tried again and it opens a greyed out window that I can't close. When I quit X11 and tried it again, it throws this error "irb: Fatal IO error 0 (Undefined error: 0) on X server /tmp/launch-n7PKmh/org.x:0." and drops out of irb.

I then started up irb again, required green_shoes and tried the second test. It threw up a X11 window with the oval as expected.

I hope that helps!

----- Original Message ----- From: ashbb reply@reply.github.com To: facetoe willcoe@westnet.com.au Sent: Mon, 23 Jan 2012 18:31:50 +0800 (WST) Subject: Re: [green_shoes] Green Shoes fails Mac (#59)

Hi facetoe,

Thank you for trying Green Shoes.

I looked at both http://pastie.org/3230151 and http://pastie.org/3234189

But sorry, I don't have a Mac, so I can't recreate your problem. :(

The error occured in show_pango_layout method in both cases. Could you confirm the following two test snippets?

 # test1
 require 'green_shoes'
 Shoes.app{}

 # test2
 require 'green_shoes'
 Shoes.app{oval 100, 100, 100}

If the above two works well, it may be Pango's problem on Mac.

ashbb


Reply to this email directly or view it on GitHub: https://github.com/ashbb/green_shoes/issues/59#issuecomment-3611787

ashbb commented 12 years ago

Umm,... maybe IRB could be the problem.

Could you try to save a snippet to a local file (e.g. test.rb) and execute (ruby test.rb)?

ashbb commented 12 years ago

And, try to the following snippet.

require 'cairo'
require 'pango'
require 'gtk2'

win = Gtk::Window.new
win.set_default_size 300, 300
canvas = Gtk::Layout.new
surface = Cairo::ImageSurface.new Cairo::FORMAT_ARGB32, 300, 300
context = Cairo::Context.new surface
layout = context.create_pango_layout
layout.text = 'hello world'
context.show_pango_layout layout
context.show_page
surface.write_to_png 'temp.png'
img = Gtk::Image.new 'temp.png'
canvas.put img, 50, 50
win.add canvas
win.show_all
Gtk.main

If it doesn't work well (doesn't display hello world), the problem may be Pango or Cairo. If it works well, we need to find another approach.

facetoe commented 12 years ago

Ok I executed the first two tests from a .rb file and they worked fine. The second test displayed the oval without having to restart X11.

When I tried the big snippet from your last email, I got this error:

Fragmachines-MacBook:bin fragmachine$ ruby test.rb test.rb:12: [BUG] Segmentation fault ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]

-- Control frame information ----------------------------------------------- c:0004 p:---- s:0016 b:0016 l:000015 d:000015 CFUNC :show_pango_layout c:0003 p:0190 s:0012 b:0012 l:000458 d:001168 EVAL test.rb:12 c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH c:0001 p:0000 s:0002 b:0002 l:000458 d:000458 TOP

-- Ruby level backtrace information ---------------------------------------- test.rb:12:in <main>' test.rb:12:inshow_pango_layout'

-- C level backtrace information -------------------------------------------

See Crash Report log file under ~/Library/Logs/CrashReporter or /Library/Logs/CrashReporter, for the more detail of.

-- Other runtime information -----------------------------------------------

[NOTE] You may have encountered a bug in the Ruby interpreter or extension libraries. Bug reports are welcome. For details: http://www.ruby-lang.org/bugreport.html

Abort trap: 6

----- Original Message ----- From: ashbb reply@reply.github.com To: facetoe willcoe@westnet.com.au Sent: Mon, 23 Jan 2012 20:20:20 +0800 (WST) Subject: Re: [green_shoes] Green Shoes fails Mac (#59)

And, try to the following snippet.

require 'cairo'
require 'pango'
require 'gtk2'

win = Gtk::Window.new
win.set_default_size 300, 300
canvas = Gtk::Layout.new
surface = Cairo::ImageSurface.new Cairo::FORMAT_ARGB32, 300, 300
context = Cairo::Context.new surface
layout = context.create_pango_layout
layout.text = 'hello world'
context.show_pango_layout layout
context.show_page
surface.write_to_png 'temp.png'
img = Gtk::Image.new 'temp.png'
canvas.put img, 50, 50
win.add canvas
win.show_all
Gtk.main

If it doesn't work well (doesn't display hello world), the problem may be Pango or Cairo. If it works well, we need to find another approach.


Reply to this email directly or view it on GitHub: https://github.com/ashbb/green_shoes/issues/59#issuecomment-3612905

ashbb commented 12 years ago

Oh, bingo! It seems that you found a bug of Ruby/GNOME2 (Pango, Cairo or something) for OSX.

I'm going to post this issue to ruby-list ML (Japanese ML), so please wait for a few days.

ashbb commented 12 years ago

OH, wait!

Before I post a mail to ruby-list ML, could you try to update some gems?

The gtk2-0.90.5 and cairo-1.10.0 are old. The latest vesion is 1.1.2.

facetoe commented 12 years ago

Ok, I updated the gems, and ran the same tests as before, but I still ran into problems:

Fragmachines-MacBook:bin fragmachine$ gem install cairo Fetching: cairo-1.10.2.gem (100%) Building native extensions. This could take a while... Successfully installed cairo-1.10.2 1 gem installed Fragmachines-MacBook:bin fragmachine$ gem install gtk2 Fetching: gtk2-1.1.2.gem (100%) Building native extensions. This could take a while... Successfully installed gtk2-1.1.2 1 gem installed Fragmachines-MacBook:bin fragmachine$ ls WeatherApp last mem.py top.py geek2 limelight monkeybars update_db geek_tool master_control.rb test.rb Fragmachines-MacBook:bin fragmachine$ open test.rb Fragmachines-MacBook:bin fragmachine$ which ruby /Users/fragmachine/.rvm/rubies/ruby-1.9.3-p0/bin/ruby Fragmachines-MacBook:bin fragmachine$ ruby test.rb

***------ I tried the first snippet, no problem:

Fragmachines-MacBook:bin fragmachine$ ruby test.rb

***------ I tried the second snippet, no problem:

Fragmachines-MacBook:bin fragmachine$ ruby test.rb

***------ I tried the detailed snippet and problem:

test.rb:12: [BUG] Segmentation fault ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]

-- Control frame information ----------------------------------------------- c:0004 p:---- s:0016 b:0016 l:000015 d:000015 CFUNC :show_pango_layout c:0003 p:0190 s:0012 b:0012 l:0000b8 d:001e18 EVAL test.rb:12 c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH c:0001 p:0000 s:0002 b:0002 l:0000b8 d:0000b8 TOP

-- Ruby level backtrace information ---------------------------------------- test.rb:12:in <main>' test.rb:12:inshow_pango_layout'

-- C level backtrace information -------------------------------------------

See Crash Report log file under ~/Library/Logs/CrashReporter or /Library/Logs/CrashReporter, for the more detail of.

-- Other runtime information -----------------------------------------------

[NOTE] You may have encountered a bug in the Ruby interpreter or extension libraries. Bug reports are welcome. For details: http://www.ruby-lang.org/bugreport.html

Abort trap: 6

----- Original Message ----- From: ashbb reply@reply.github.com To: facetoe willcoe@westnet.com.au Sent: Mon, 23 Jan 2012 22:25:40 +0800 (WST) Subject: Re: [green_shoes] Green Shoes fails Mac (#59)

OH, wait!

Before I post a mail to ruby-list ML, could you try to update some gems?

The gtk2-0.90.5 and cairo-1.10.0 are old. The latest vesion is 1.1.2.


Reply to this email directly or view it on GitHub: https://github.com/ashbb/green_shoes/issues/59#issuecomment-3614501

ashbb commented 12 years ago

I updated the gems, and ran the same tests as before, but I still ran into problems:

Oh, sorry. Thank you for taking the time...

BTW, I posted about this issue to Shoes ML (librelist.com) and got an answer. Look at this: http://is.gd/qovghR

But I'm not sure this will be for your solution...

facetoe commented 12 years ago

I reinstalled 1.9.2, with no success! I still get the same error. Hopefully someone can figure it out...

----- Original Message ----- From: ashbb reply@reply.github.com To: facetoe willcoe@westnet.com.au Sent: Tue, 24 Jan 2012 05:44:58 +0800 (WST) Subject: Re: [green_shoes] Green Shoes fails Mac (#59)

I updated the gems, and ran the same tests as before, but I still ran into problems:

Oh, sorry. Thank you for taking the time...

BTW, I posted about this issue to Shoes ML (librelist.com) and got an answer. Look at this: http://is.gd/qovghR

But I'm not sure this will be for your solution...


Reply to this email directly or view it on GitHub: https://github.com/ashbb/green_shoes/issues/59#issuecomment-3622487

ashbb commented 12 years ago

Hi facetoe,

I posted a mail to ruby-list ML (Japanese ML) and got an advice.

So, I posted this: http://lists.freedesktop.org/archives/pixman/2012-January/001661.html

Hope someone will answer, ashbb

facetoe commented 12 years ago

Thanks ashbb, hopefully someone can help!

----- Original Message ----- From: ashbb reply@reply.github.com To: facetoe willcoe@westnet.com.au Sent: Wed, 25 Jan 2012 20:10:29 +0800 (WST) Subject: Re: [green_shoes] Green Shoes fails Mac (#59)

Hi facetoe,

I posted a mail to ruby-list ML (Japanese ML) and got an advice.

So, I posted this: http://lists.freedesktop.org/archives/pixman/2012-January/001661.html

Hope someone will answer, ashbb


Reply to this email directly or view it on GitHub: https://github.com/ashbb/green_shoes/issues/59#issuecomment-3649576

blackrat commented 11 years ago

I had exactly the same problem with an rvm installed Ruby 1.9.3 on my mac. It turns out that it was installed with clang rather than gcc 4.2.2. I switched to using the homebrew installation of gcc, reinstalled 1.9.3 and the segfault in show_pango_layout disappeared. Hope this helps.