1

I installed shoes gem but I can't use it:

> gem install green_shoes                                                                                                
Successfully installed green_shoes-1.1.374                                                                               
Parsing documentation for green_shoes-1.1.374                                                                            
unable to convert "\xA9" from ASCII-8BIT to UTF-8 for lib/shoes/minitar.rb, skipping                                     
Done installing documentation for green_shoes after 1 seconds                                                            
1 gem installed                                                                                                          

olivier@FIXE C:\Users\olivier\Documents\ruby                                                                             
> irb                                                                                                                    
irb(main):001:0> require 'green_shoes'                                                                                   
LoadError: cannot load such file -- gobject-introspection                                                                
        from C:/Ruby23-x64/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'                  
        from C:/Ruby23-x64/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'                  
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/gdk_pixbuf2-3.0.9-x64-mingw32/lib/gdk_pixbuf2.rb:17:in `<top (require
d)>'                                                                                                                     
        from C:/Ruby23-x64/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'                  
        from C:/Ruby23-x64/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'                  
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/green_shoes-1.1.374/lib/green_shoes.rb:5:in `<top (required)>'       
        from C:/Ruby23-x64/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:133:in `require'                 
        from C:/Ruby23-x64/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:133:in `rescue in require'       
        from C:/Ruby23-x64/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in `require'                  
        from (irb):1                                                                                                     
        from C:/Ruby23-x64/bin/irb.cmd:19:in `<main>'       

How to fix this issue?

EDIT:

I installed the 2 gems, but a simple demo program (which begins with "require 'green_shoes'", gives this error:

ruby test1.rb C:/Ruby23/lib/ruby/site_ruby/2.3.0/rubygems/specification.rb:2288:in `raise_if_conflicts': Unable to activate gobject-introspection-3.0.8-x86-mingw32, because glib2-3.0.9-x86-mingw32 conflicts with glib2 (= 3.0.8) (Gem::ConflictError)

here is the program:

require 'green_shoes'

puts "hello world"

puts Math.sqrt(9)

def say_hi(name="!")
    puts "hello world #{name}"
end

say_hi("Olivier")
say_hi

class Greeter
    def initialize(name)
        @name=name

    end

    def say_hello
        puts "hello #{@name.capitalize}"
    end

    def to_s
        "I said hello!"
    end


end

g=Greeter.new("olivier")
g.say_hello
puts g
 # hello_world.rb


Shoes.app do
  para "Hello World"
end

Shoes.app { button "Push me" }

it's a test program, it does not contain important things.

ps: I understand the conflict between the 2 versions of glib2, but I hesitate about which version to remove: I don't want to break my ruby installation. Which should I remove?

EDIT2:

there's still an issue : green_shoes requires the installation of pango and cairo, but of other versions that 3.0.8:

gem uninstall glib2 -v 3.0.9
You have requested to uninstall the gem:
glib2-3.0.9-x86-mingw32
atk-3.0.9 depends on glib2 (= 3.0.9)
gdk_pixbuf2-3.0.9 depends on glib2 (= 3.0.9)
pango-3.0.9 depends on glib2 (= 3.0.9) If you remove this gem, these dependencies will not be met.

I don't know how I should do... which version of green_shoes have you got?

ps: I just saw the rest of your edit; the strabge thing is that I have got the same version of green_shoes than yours...but for me was installed glib2-3.0.9, and for you glib2 3.0.8.... I thought at remove green_shoes, and its dependencies, then install some dependencies in 3.0.8 version, then install green_shoes and hope it does not requires 3.0.9 versions of its dependencies no more... What do you think about that?

EDIT3:

snif! it's what I was afraid of!

here is the result of the installation of green_shoes:

    > gem install green_shoes 
Fetching: glib2-3.0.9-x86-mingw32.gem (100%) 
Successfully installed glib2-3.0.9-x86-mingw32 
Fetching: green_shoes-1.1.374.gem (100%) 
Successfully installed green_shoes-1.1.374

and now I have the 2 versions of glib2(3.0.8 & 3.0.9)

EDIT4:

I don't understand anything : have a look at this:

gem list glib2

* LOCAL GEMS * glib2 (3.0.9 x86-mingw32)
olivier@FIXE C:\Users\olivier\Documents\ruby

ruby test2.rb C:/Ruby23/lib/ruby/site_ruby/2.3.0/rubygems/specification.rb:2288:in `raise_if_conflic ts': Unable to activate gobject-introspection-3.0.8-x86-mingw32, because glib2-3.0.9-x 86-mingw32 conflicts with glib2 (= 3.0.8) (Gem::ConflictError)

I removed glib2 v 3.0.8 but there is still a conflict...

EDIT5:

I followed your advice, and removed version 3.0.9, but strangely it seems that version 3.0.8 is still needed:

ruby test2.rb C:/Ruby23/lib/ruby/site_ruby/2.3.0/rubygems/dependency.rb:310:in to_specs': Could not find 'glib2' (= 3.0.9) - did find: [glib2-3.0.8-x86-mingw32] (Gem::MissingSpecVersionError) Checked in 'GEM_PATH=C:/Users/olivier/.gem/ruby/2.3.0;C:/Ruby23/lib/ruby/gems/2.3.0', executegem env` for more information

althought I removed its 3.0.8 dependencies, and let the 3.0.9 stay. still, I don't understand.

Cœur
  • 37,241
  • 25
  • 195
  • 267
lolveley
  • 1,659
  • 2
  • 18
  • 34
  • which ruby_gtk2 package are you running? – MageeWorld Oct 15 '16 at 19:36
  • @MageeWorld : well, I don't know, but I installed the 2 packages mentionned in the answer of peter; I hope it answers to your question! – lolveley Oct 16 '16 at 16:22
  • I added glib2 to my answer. your testprogram runs fine on my configuration, see also my answer at http://stackoverflow.com/questions/39871055/my-classes-cant-use-shoes-methods-like-para/39872261#39872261 if you need to interact between shoes and other classes – peter Oct 16 '16 at 16:38
  • gem uninstall glib2 -v 3.0.9 and gem install glib2 -v 3.0.8 – peter Oct 16 '16 at 16:54

1 Answers1

1

I recently reïnstalled green_shoes under Windows7 and Ruby 2.3.0 and had no difficulties, here the gdk versions that are used on my system. Install them seperate while specifying this version. Don't know if necessary here but it is always advisable to have the devkit in your path.

Versions:

gdk3 (3.0.8 x64-mingw32)
gdk_pixbuf2 (3.0.8 x64-mingw32)

Install them by

gem install gdk3 -v 3.0.8
gem install gdk_pixbuf2 -v 3.0.8

EDIT

My glib version is as follows, i suggest you check your current version with gem list glib2, note it down, install my version and if things break you can always gem uninstall glib2 and reinstall the old version.

glib2 (3.0.8 x64-mingw32)

The following command should list all the dependencies but doesn't seem to recurse so let me know if I need to go any deeper.

C:\Users\Gebruiker>gem dependency green_shoes --reverse-dependencies
Gem green_shoes-1.1.374
  gtk2 (>= 0)



C:\Users\Gebruiker>gem dependency gtk2 --reverse-dependencies
Gem gtk2-3.0.8-x64-mingw32
  atk (= 3.0.8)
  gdk_pixbuf2 (= 3.0.8)
  pango (= 3.0.8)
  Used by
    green_shoes-1.1.374 (gtk2 (>= 0))

Gem pango-3.0.8-x64-mingw32
  cairo (>= 1.14.0)
  glib2 (= 3.0.8)
  Used by
    gdk3-3.0.8-x64-mingw32 (pango (= 3.0.8))
    gtk2-3.0.8-x64-mingw32 (pango (= 3.0.8))
    gtk3-3.0.8-x64-mingw32 (pango (= 3.0.8))
    rsvg2-3.0.8-x64-mingw32 (pango (>= 3.0.8))

EDIT2

I managed to get a full dependecy tree by using this answer

{"green_shoes 1.1.374"=>
  {"gtk2 3.0.8"=>
    {"gtk2 3.0.8"=>
      {"atk 3.0.8"=>
        {"atk 3.0.8"=>
          {"glib2 3.0.8"=>
            {"glib2 3.0.8"=>
              {"pkg-config 1.1.7"=>{"pkg-config 1.1.7"=>{}},
               "cairo 1.15.2"=>
                {"cairo 1.15.2"=>
                  {"pkg-config 1.1.7"=>{"pkg-config 1.1.7"=>{}}}}}}}},
       "pango 3.0.8"=>
        {"pango 3.0.8"=>
          {"cairo 1.15.2"=>
            {"cairo 1.15.2"=>{"pkg-config 1.1.7"=>{"pkg-config 1.1.7"=>{}}}},
           "glib2 3.0.8"=>
            {"glib2 3.0.8"=>
              {"pkg-config 1.1.7"=>{"pkg-config 1.1.7"=>{}},
               "cairo 1.15.2"=>
                {"cairo 1.15.2"=>
                  {"pkg-config 1.1.7"=>{"pkg-config 1.1.7"=>{}}}}}}}},
       "gdk_pixbuf2 3.0.8"=>
        {"gdk_pixbuf2 3.0.8"=>
          {"glib2 3.0.8"=>
            {"glib2 3.0.8"=>
              {"pkg-config 1.1.7"=>{"pkg-config 1.1.7"=>{}},
               "cairo 1.15.2"=>
                {"cairo 1.15.2"=>
                  {"pkg-config 1.1.7"=>{"pkg-config 1.1.7"=>{}}}}}}}}}}}}
Community
  • 1
  • 1
peter
  • 41,770
  • 5
  • 64
  • 108