# Problems with Ruby 2.1 & Windows 8

**URL:** <https://www.ruby-forum.com/t/problems-with-ruby-2-1-windows-8/241863>\
**Category:** Ruby-Gnome 2\
**Created:** [May 6, 2015, 7:55pm UTC](https://www.ruby-forum.com/t/problems-with-ruby-2-1-windows-8/241863 "2015-05-06T19:55:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Detlef\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Post date:** [May 6, 2015, 7:55pm UTC](https://www.ruby-forum.com/t/problems-with-ruby-2-1-windows-8/241863/1 "2015-05-06T19:55:39Z")

</div>

Hi, I’ve been trying to upgrade my workplaces ruby version from 1.8.6 to  
2.1, and one of our most important projects is done in Gtk2. I finally  
have the gtk2 (2.2.5-x86-mingw32) installed properly in windows on ruby  
2.1, but the code behavior is all wrong. I first thought it was  
just some small api changes, but I think now its a serious bug.

I’ve made a small program to demonstrate.

* * *

require ‘gtk2’

window = Gtk::Window.new()  
window.set\_default\_size(200, 200)

window.signal\_connect(“destroy”) do  
Gtk.main\_quit  
end

a = Gtk::VBox.new()

a.pack\_start(Gtk::TextView.new())  
a.pack\_start(Gtk::Button.new())  
a.pack\_start(Gtk::TextView.new())

window.add(a)

## window.show\_all() Gtk.main()

If I click on any of the TextViews or the button, the focus gets stuck  
on that widget and I can’t click on any of the other widgets via mouse.  
I have no idea why it would do that. If anybody happens to have a clue  
on how to fix this I would really appreciate it! Otherwise I’ll have to  
give up on the upgrade and run everything on ruby 1.8.6 until the end of  
time…

Edit: Forgot to mention, I tried going back to the 2.1.0 gem and had  
the same problem. Any further back and the gem’s don’t seem compatible  
with ruby 2.1.

---

<div class="post-metadata">

**Author:** ![lakilevi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/bc79bd/32.png) [@lakilevi](https://www.ruby-forum.com/u/lakilevi)\
**Post date:** [May 11, 2015, 8:24pm UTC](https://www.ruby-forum.com/t/problems-with-ruby-2-1-windows-8/241863/2 "2015-05-11T20:24:00Z")

</div>

I did a bit more digging, trying different versions of GTK sans ruby  
(running gtk-demo.exe) to see if I would have the same problem. It  
works fine until GTK 2.18, where it has the same problem as my ruby  
code (GTK 2.16 works fine).

Hmm, I’ll keep thinking about this.

---

<div class="post-metadata">

**Author:** ![lakilevi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/bc79bd/32.png) [@lakilevi](https://www.ruby-forum.com/u/lakilevi)\
**Post date:** [May 11, 2015, 9:49pm UTC](https://www.ruby-forum.com/t/problems-with-ruby-2-1-windows-8/241863/3 "2015-05-11T21:49:54Z")

</div>

In GTK 2.18, setting the environment variable GDK\_NATIVE\_WINDOWS fixes  
it as well, but that doesn’t seem to work in later versions or the ruby  
gem.

---

<div class="post-metadata">

**Author:** ![lakilevi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/bc79bd/32.png) [@lakilevi](https://www.ruby-forum.com/u/lakilevi)\
**Post date:** [May 12, 2015, 12:10am UTC](https://www.ruby-forum.com/t/problems-with-ruby-2-1-windows-8/241863/4 "2015-05-12T00:10:48Z")

</div>

Man, I want to pull my hair out. I can’t find anyone else having the  
same problems with GTK & Windows 8, so its probably something weird with  
my system. ☹

Oh well.

---

<div class="post-metadata">

**Author:** ![lakilevi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/bc79bd/32.png) [@lakilevi](https://www.ruby-forum.com/u/lakilevi)\
**Post date:** [May 12, 2015, 1:03am UTC](https://www.ruby-forum.com/t/problems-with-ruby-2-1-windows-8/241863/5 "2015-05-12T01:03:03Z")

</div>

Problem solved. I ran windows update and now everything magically  
works. Guess it was a bug in windows. 🙂
