LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 06-25-2013, 04:37 PM   #1
baronobeefdip
Senior Member
 
Registered: Jul 2009
Distribution: Debian Squeeze
Posts: 1,177

Rep: Reputation: 32
ruby-gtk2 not working


I am using ubuntu studio and just downloaded the package "ruby-gtk2". The I created a program that looks like this
Code:
require 'gtk'

window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)
button = Gtk::Button.new('Hello World')
window.add button
button.show
window.show
Gtk.main
But whenever I run it I get errors, here is the message.
Code:
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- gtk (LoadError)
        from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from gtk.rb:1:in `<main>'
What can I do to fix this, do I need a later version of the ruby interpreter. What exactly is my problem here?
 
Old 06-26-2013, 05:05 AM   #2
grail
Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 7,428

Rep: Reputation: 1876Reputation: 1876Reputation: 1876Reputation: 1876Reputation: 1876Reputation: 1876Reputation: 1876Reputation: 1876Reputation: 1876Reputation: 1876Reputation: 1876
I wonder if the fact that you installed ruby-gtk2 might mean you need to require gtk2
 
Old 07-04-2013, 12:29 PM   #3
baronobeefdip
Senior Member
 
Registered: Jul 2009
Distribution: Debian Squeeze
Posts: 1,177

Original Poster
Rep: Reputation: 32
That worked, Thanks
 
Old 07-04-2013, 12:51 PM   #4
grail
Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 7,428

Rep: Reputation: 1876Reputation: 1876Reputation: 1876Reputation: 1876Reputation: 1876Reputation: 1876Reputation: 1876Reputation: 1876Reputation: 1876Reputation: 1876Reputation: 1876
Please mark as SOLVED once you have a solution
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache web with Ruby not working tbaror Linux - Server 0 05-15-2012 03:25 AM
[ruby][gtk2] Style Property - How to change? robuxbiz Programming 3 06-06-2010 04:46 AM
Install of Ruby on Rails not working thepr1nter Linux - Software 0 06-08-2007 03:29 PM
ruby/gtk2 drawingarea Komakino Programming 3 07-06-2006 10:01 PM
Am iI a total noob? I Want better window Gui for gtk2 apps when working in gnome!!!!! Samppa72 Linux - Distributions 1 06-07-2004 04:46 PM


All times are GMT -5. The time now is 11:08 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration