# Install\_qtruby\_on\_mac

**URL:** <https://rubytalk.org/t/install-qtruby-on-mac/24452>\
**Category:** ruby-talk\
**Created:** [30 January 2006 10:42 UTC](https://rubytalk.org/t/install-qtruby-on-mac/24452 "2006-01-30T10:42:22Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryutaro\_Amano](https://avatars.discourse-cdn.com/v4/letter/r/ee59a6/32.png) [@Ryutaro\_Amano](https://rubytalk.org/u/Ryutaro_Amano)\
**Post date:** [30 January 2006 10:42 UTC](https://rubytalk.org/t/install-qtruby-on-mac/24452/1 "2006-01-30T10:42:22Z")

</div>

Hi, I am Ryutaro Amano.  
I am using ruby-1.8.4 on Mac 10.4.4 with XCode-2.2  
I have installed qtruby-1.0.10

the following steps  
after archiving qt-mac-free-3.3.6-snapshot-20060127.tar.bz2, mv /Developer/qt

export QTDIR=/Developer/qt  
export PATH=$QTDIR/bin:$PATH  
export MANPATH=$QTDIR/doc/man:$MANPATH  
export DYLD\_LIBRARY\_PATH=$QTDIR/lib:$DYLD\_LIBRARY\_PATH

cd /Developer/qt/  
./configure -thread  
make  
sudo ln -sf $QTDIR/lib/libqt.3.dylib /usr/lib  
sudo ln -sf $QTDIR/lib/libqui.1.dylib /usr/lib

after archiving qtruby-1.0.10  
cd qtruby-1.0.10  
./configure --enable-mac --with-qt-dir=/Developer/qt --with-qt-includes=/Developer/qt/include --with-qt-libraries=/Developer/qt/lib

cd smoke/qt  
perl [generate.pl](http://generate.pl)  
qmake -makefile  
sudo make

cd../..  
cd qtruby/rubylib/qtruby  
ruby extconf.rb --with-qt-dir=/Developer/qt --with-smoke-dir=/usr --with-smoke-include=../../../smoke  
make  
sudo make install

cd ../..  
cd qtruby/rubylib/designer/rbuic  
qmake -makefile  
sudo make

cd ../..  
cd qtruby/rubylib/designer/uilib  
ruby extconf.rb --with-qtruby-include=../../qtruby --with-qt-dir=/Developer/qt  
make  
sudo make install

I have verified the installation  
irb \> require "Qt"  
dyld:NSLinkModule()error  
dyld:Librarynotloaded:libqt-mt.3.dylib  
Referencedfrom:/usr/lib/ruby/.../qtruby.bundle  
Reason:imagenotfound  
Trace/BPTtrap

I did  
sudo ln -sf /Developer/qt/lib/libqt-mt.3.dylib /usr/lib

irb \> require "Qt"  
=\>true

OK !!  
I tried "qtruby-1.0.10/qtruby/rubylib/tutorial/t1/t1.rb"

> **···**
>
> ----------------------------------------------  
> #!/usr/bin/env ruby  
> $VERBOSE = true; $:.unshift File.dirname($0)
> 
> require 'Qt'
> 
> a = Qt::Application.new(ARGV)  
> hello = Qt::PushButton.new('Hello World!', nil)  
> hello.resize(100, 30)  
> a.setMainWidget(hello)  
> hello.show()  
> a.exec()  
> --------------------------------------------  
> ruby /Users/emergency\_mini/QtRuby/qtruby-1.0.10/qtruby/rubylib/tutorial/t1/t1.rb
> 
> the window appears background of Terminal and the windows is disabled, gray color.  
> the close button, the minimum button, the maximum button work.  
> But the color of the window is gray, the color of disabled state.  
> Why?
> 
> tutorial/t2/t2.rb and tutorial/t3/t3.rb are the same result.  
> "Quit" button works  
> -----------------------------------t2-----------------------------  
> #!/usr/bin/env ruby  
> $VERBOSE = true; $:.unshift File.dirname($0)
> 
> require 'Qt';
> 
> a = Qt::Application.new(ARGV)
> 
> quit = Qt::PushButton.new('Quit', nil)  
> quit.resize(75, 30)  
> quit.setFont(Qt::Font.new('Times', 18, Qt::Font::Bold))
> 
> Qt::Object.connect(quit, SIGNAL('clicked()'), a, SLOT('quit()'))
> 
> a.setMainWidget(quit)  
> quit.show  
> a.exec  
> exit  
> -----------------------------------------------------------------------
> 
> The window of tutorial4 have not button.  
> ---------------------------------------------------------------------  
> #!/usr/bin/env ruby  
> $VERBOSE = true; $:.unshift File.dirname($0)
> 
> require 'Qt'
> 
> class MyWidget \< Qt::Widget
> 
> def initialize(parent = nil, name = nil)  
> &nbsp;&nbsp;super  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;setMinimumSize(200, 120)  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;setMaximumSize(200, 120)
> 
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;quit = Qt::PushButton.new('Quit', self, 'quit')  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;quit.setGeometry(62, 40, 75, 30)  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;quit.setFont(Qt::Font.new('Times', 18, Qt::Font::Bold))  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;connect(quit, SIGNAL('clicked()'), $qApp, SLOT('quit()'))  
> end
> 
> end
> 
> a = Qt::Application.new(ARGV)
> 
> w = MyWidget.new  
> w.setGeometry(100, 100, 200, 120)  
> a.setMainWidget(w)  
> w.show  
> a.exec  
> ----------------------------------------------------------------------
> 
> Ryutaro Amano  
> [wn9r-amn@asahi-net.or.jp](mailto:wn9r-amn@asahi-net.or.jp)

---

<div class="post-metadata">

**Author:** ![Mark\_Somerville](https://avatars.discourse-cdn.com/v4/letter/m/46a35a/32.png) [@Mark\_Somerville](https://rubytalk.org/u/Mark_Somerville)\
**Post date:** [30 January 2006 11:46 UTC](https://rubytalk.org/t/install-qtruby-on-mac/24452/2 "2006-01-30T11:46:17Z")

</div>

> Hi, I am Ryutaro Amano.  
> I am using ruby-1.8.4 on Mac 10.4.4 with XCode-2.2  
> I have installed qtruby-1.0.10

\<snip\>

Hello.

There is a bug in version 1.0.10 when using Ruby 1.8.4 - it is some sort of  
problem with calling super when subclassing the Qt classes, which will create  
the problem you describe below.

An upgrade to 1.0.11 should fix the problem.

Mark

> **···**
>
> On Monday 30 January 2006 10:42, 天野 竜太郎 wrote:
> 
> > -----------------------------------------------------------------------
> > 
> > The window of tutorial4 have not button.  
> > ---------------------------------------------------------------------  
> > #!/usr/bin/env ruby  
> > $VERBOSE = true; $:.unshift File.dirname($0)
> > 
> > require 'Qt'
> > 
> > class MyWidget \< Qt::Widget
> > 
> > def initialize(parent = nil, name = nil)  
> > &nbsp;&nbsp;super  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;setMinimumSize(200, 120)  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;setMaximumSize(200, 120)
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;quit = Qt::PushButton.new('Quit', self, 'quit')  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;quit.setGeometry(62, 40, 75, 30)  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;quit.setFont(Qt::Font.new('Times', 18, Qt::Font::Bold))  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;connect(quit, SIGNAL('clicked()'), $qApp, SLOT('quit()'))  
> > end
> > 
> > end
> > 
> > a = Qt::Application.new(ARGV)
> > 
> > w = MyWidget.new  
> > w.setGeometry(100, 100, 200, 120)  
> > a.setMainWidget(w)  
> > w.show  
> > a.exec

---

<div class="post-metadata">

**Author:** ![Ryutaro\_Amano](https://avatars.discourse-cdn.com/v4/letter/r/ee59a6/32.png) [@Ryutaro\_Amano](https://rubytalk.org/u/Ryutaro_Amano)\
**Post date:** [30 January 2006 12:06 UTC](https://rubytalk.org/t/install-qtruby-on-mac/24452/3 "2006-01-30T12:06:46Z")

</div>

Thanks Mark  
I thought upgrade to 1.0.11.  
But I didn't how to upgrade.  
There is not "./configure" file in "1.0.11" directory.  
Please tech me the way to upgrade.

Ryutaro Amano  
[wn9r-amn@asahi-net.or.jp](mailto:wn9r-amn@asahi-net.or.jp)

---

<div class="post-metadata">

**Author:** ![Mark\_Somerville](https://avatars.discourse-cdn.com/v4/letter/m/46a35a/32.png) [@Mark\_Somerville](https://rubytalk.org/u/Mark_Somerville)\
**Post date:** [30 January 2006 12:26 UTC](https://rubytalk.org/t/install-qtruby-on-mac/24452/4 "2006-01-30T12:26:47Z")

</div>

> Thanks Mark  
> I thought upgrade to 1.0.11.  
> But I didn't how to upgrade.  
> There is not "./configure" file in "1.0.11" directory.  
> Please tech me the way to upgrade.

Ryutaro,

Try this line before you configure:

make -f Makefile.cvs

There is also a section on installing on OSX in the "INSTALL" document that is  
bundled with QtRuby. I've never installed QtRuby on OSX, but would be very  
interested to hear what works (or doesn't!).

Hope that helps.

Mark

> **···**
>
> On Monday 30 January 2006 12:06, Ryutaro Amano wrote:
> 
> > Ryutaro Amano  
> > wn9r-amn@asahi-net.or.jp

---

<div class="post-metadata">

**Author:** ![Ryutaro\_Amano](https://avatars.discourse-cdn.com/v4/letter/r/ee59a6/32.png) [@Ryutaro\_Amano](https://rubytalk.org/u/Ryutaro_Amano)\
**Post date:** [30 January 2006 13:26 UTC](https://rubytalk.org/t/install-qtruby-on-mac/24452/5 "2006-01-30T13:26:06Z")

</div>

> Try this line before you configure:
> 
> make -f Makefile.cvs

I tried. Thank you useful help.  
I resolved the problem of tutorial 4 that the window have not a button.  
But I didn't resolve the problem that the windows are disabled, the zooming box (right bottom) don't work.  
I will try qt-mac-free-3.3.5 instead of qt-mac-free-3.3.6-snapshot-20060127.

Ryutaro Amano  
wn9r-amn@asahi-net.or.jp

---

<div class="post-metadata">

**Author:** ![Mark\_Somerville](https://avatars.discourse-cdn.com/v4/letter/m/46a35a/32.png) [@Mark\_Somerville](https://rubytalk.org/u/Mark_Somerville)\
**Post date:** [30 January 2006 16:06 UTC](https://rubytalk.org/t/install-qtruby-on-mac/24452/6 "2006-01-30T16:06:07Z")

</div>

> \> Try this line before you configure:  
> \>  
> \> make -f Makefile.cvs
> 
> I tried. Thank you useful help.  
> I resolved the problem of tutorial 4 that the window have not a button.

Cool.

> But I didn't resolve the problem that the windows are disabled, the  
> zooming box (right bottom) don't work.  
> I will try qt-mac-free-3.3.5 instead of qt-mac-free-3.3.6-  
> snapshot-20060127.

It would be great if you could let us know how you get on.

Good luck,

Mark

> **···**
>
> On Monday 30 January 2006 13:26, Ryutaro Amano wrote:
> 
> > Ryutaro Amano  
> > wn9r-amn@asahi-net.or.jp

---

<div class="post-metadata">

**Author:** ![Hans\_Fugal2](https://avatars.discourse-cdn.com/v4/letter/h/ed655f/32.png) [@Hans\_Fugal2](https://rubytalk.org/u/Hans_Fugal2)\
**Post date:** [1 February 2006 21:40 UTC](https://rubytalk.org/t/install-qtruby-on-mac/24452/7 "2006-02-01T21:40:47Z")

</div>

Please see this thread:  
[http://groups.google.com/group/comp.lang.ruby/browse\_frm/thread/fd7daa4329cd199a/01b7bea1b7794cae?q=qtruby+os+x&rnum=1#01b7bea1b7794cae](http://groups.google.com/group/comp.lang.ruby/browse_frm/thread/fd7daa4329cd199a/01b7bea1b7794cae?q=qtruby+os+x&rnum=1#01b7bea1b7794cae)

---

<div class="post-metadata">

**Author:** ![Ryutaro\_Amano](https://avatars.discourse-cdn.com/v4/letter/r/ee59a6/32.png) [@Ryutaro\_Amano](https://rubytalk.org/u/Ryutaro_Amano)\
**Post date:** [31 January 2006 01:53 UTC](https://rubytalk.org/t/install-qtruby-on-mac/24452/8 "2006-01-31T01:53:23Z")

</div>

I have installed qt-mac-free-3.3.5 instead of qt-mac-free-3.3.6-snapshot-20060127 and reinstalled qtruby-1.0.11.

But, the result is same.  
The tutorials 1-14 work, but the state of these windows are disable.  
The tutorial 14 is simple game. The game works well, but the state of the window is not correct.  
If I want to look at the window of the game, I must minimum the window of the terminal.  
Even if I click the window of the game, the window don't become foreground.

I did the following way.

sudo cp /usr/local/bin/ruby /usr/local/bin/rubyw  
sudo /Developer/Tools/Rez -t APPL Carbon.r -o rubyw  
rubyw fullpath/qt.rb

The result is same.

Ryutaro Amano  
[wn9r-amn@asahi-net.or.jp](mailto:wn9r-amn@asahi-net.or.jp)
