I’m building ruby-2.0.0-p0 on a Raspberry Pi running Raspbian wheezy,
which essentially is a debian linux variant for the armv6 and Pi. I also
need to have tk 8.5 with it… but I have run into a really strange
problem.
This is how it’s built:
sudo apt-get install tcl8.5-dev
sudo apt-get install tk8.5-dev
pushd /usr/lib/
sudo ln -s tcl8.5/tclConfig.sh ./
sudo ln -s tk8.5/tkConfig.sh ./
popd
tar xzf ruby-2.0.0-p0.tar.gz
cd ruby-2.0.0-p0
./configure --disable-install-doc --prefix=/usr/local/ruby2
make
sudo make install
When I try out “irb” and some simple scripts, the ruby itself seems to
work fine. If I do “wish” that seems to work too. The configure and make
output doesn’t show any problems as far as I can see. But when I do
“require ‘tk’” it just hangs! Hitting ctrl-C shows that it’s hanging
(or looping) in this code:
check a Tcl/Tk interpreter is initialized
until INTERP_THREAD[:interp]
Thread.pass
INTERP_THREAD.run
end
That’s line 1327 in tk.rb (the .run call). Then “exit” doesn’t work, I
have to do a kill -9 to make irb terminate.
And now it gets really weird… In an attempt to figure out what it was
doing I attached an strace to the process… but then it suddenly starts
running as it should, and seems to work fine!
Now I can hardly run it with an strace on it all the time, so it doesn’t
help unfortunately. But perhaps it’s clue for someone about what’s
going on?
I have never come across this kind of behavior before, and I have some
experience. (25+ years as a systems programmer on unix/linux). I have
built different ruby versions on countless linux versions without any
problems. I’m at a loss here, no idea what to do about this.
Btw, I have of course tried the Raspberry Pi forums, but no response
yet…