WxRuby installation solution for Ubuntu 9.10

Hi
Chauk-Mean P.

The wxruby Linux gem has been built with/for Ubuntu 9.04.
A different C++ compiler version is shipped with Ubuntu 9.10 (g++
4.4.1).
So the gem is not compatible with Ubuntu 9.10.

We may provide a Ubuntu-9.10 binary gem in the future but in the
meantime you have to build wxRuby yourself.

I’ve tried to compile wxRuby from scratch but no luck.? What do I need to
do?

I’ve added detailed steps to do that in the Wiki :
http://wxruby.rubyforge.org/wiki/wiki.pl?BuildingOnTopOfLinuxDistroPackages

Thank you for your assistance. However I still failed to get wxruby
working after I followed your instructions.
Below is a partial listing of my attempt to get wxruby working.

xxx:~$ g++ --version
g++ (Ubuntu 4.4.1-4ubuntu8) 4.4.1

xxx:~/Downloads$ ls
ruby-1.9.1-p243 swig-1.3.38 wxruby-2.0.1

xxx:~/Downloads$ xxx:~/Downloads/wxruby-2.0.1$ ls
art INSTALL obj README swig
ChangeLog lib rake samples tests
doc LICENSE rakefile src wxruby-ruby19-2.0.1-x86-linux.gem
xxx:~/Downloads/wxruby-2.0.1$

xxx:~/Downloads/wxruby-2.0.1$ sudo gem install
wxruby-ruby19-2.0.1-x86-linux.gem
[sudo] password for philip:
Successfully installed wxruby-ruby19-2.0.1-x86-linux
1 gem installed
Installing ri documentation for wxruby-ruby19-2.0.1-x86-linux…
Updating class cache with 68 classes…
Installing RDoc documentation for wxruby-ruby19-2.0.1-x86-linux…
xxx:~/Downloads/wxruby-2.0.1$

xxx:~/Desktop/Eyes$ cat wxminimal.rb

#!/usr/bin/env ruby
require ‘rubygems’
require ‘wx’

class MyApp < Wx::App
def on_init
@frame = Wx::Frame.new(nil -1, “Application” )
@frame.show
end
end

app = MyApp.new
app.main_loop

xxx:~/Desktop/Eyes$ ruby wxminimal.rb
wxminimal.rb:3:in require': no such file to load -- wx (LoadError) from wxminimal.rb:3:in

xxx:~/Desktop/Eyes$ ruby --version
ruby 1.9.1p243 (2009-07-16 revision 24175) [i686-linux]

At one time, sudo gem install failed when I tried to install the gem
file but succeeded when I didn’t use sudo.
So I installed rubygems 1.9.1 and then the sudo install gem -l …
command worked. However when I tried the
minimal test program shown above I get the shown error message.
Another thing I should mention for people who
start from a clean system is after you edit the .bashrc file you
should close the terminal and re-open it to allow
the path variables to take effect.

I hope you can help me. What other info do you require?

Philip

Hi Philip,

2009/11/18 Philip S. [email protected]:

Thank you for your assistance. However I still failed to get wxruby working
after I followed your instructions.

I forgot to indicate a little step :
add the following line to your .bashrc (replace the path with your
home directory)

export GEM_HOME=/home/your_home/gems

This will allow the installation of rubygems somewhere in your home
directory thus without requiring a sudo.

xxx:~/Downloads/wxruby-2.0.1$ sudo gem install
wxruby-ruby19-2.0.1-x86-linux.gem

Be sure to add -l to the gem command to install the local gem.
Otherwise gem will install the version from rubyforge which is not the
good one.
Also, when you do a sudo command, the environment changes so you
probably use the gem command shipped with Ubuntu and not the one you
built yourself (the one that is in /opt/bin).

[sudo] password for philip:
Successfully installed wxruby-ruby19-2.0.1-x86-linux
1 gem installed
Installing ri documentation for wxruby-ruby19-2.0.1-x86-linux…
Updating class cache with 68 classes…
Installing RDoc documentation for wxruby-ruby19-2.0.1-x86-linux…

The wrong wxRuby gem has been installed for the wrong ruby/gem :slight_smile:

With the GEM_HOME env parameter above set, just do the following
command in your wxruby source directory :
gem install -l wxruby-ruby19

Afterwards, some final checks :
type gem # => /opt/bin/gem
type ruby # => /opt/bin/ruby
gem list # => should list wxruby-ruby19

Then you should be able to run the samples.

Cheers.
Chauk-Mean.