[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

gem and rmagic confusion

paul.rogers

11/29/2004 3:06:00 PM

Im very confused by whats happening with rmagic and rubygem. Now, Im
the first to admit that i didnt read much in the way of the
installation instructions.

Ive got gems installed , 0.8.1 on windows
Ive installed rmagic with the gem:

C:\>gem list

*** LOCAL GEMS ***

RMagick-win32 (1.6.0)
RMagick is an interface between the Ruby programming language and
the ImageMagick and GraphicsMagick image processing libraries.

sources (0.0.1)
This package provides download sources for remote gem installation


now, the rmagic sample use require 'RMagick'
which gives me:
C:/ruby/lib/ruby/gems/1.8/gems/RMagick-win32-1.6.0-mswin32/doc/ex/border.rb:2:in
`require': No such file to load -- RMagick (LoadError)
from C:/ruby/lib/ruby/gems/1.8/gems/RMagick-win32-1.6.0-mswin32/doc/ex/border.rb:2

If I change to :
require 'rubygems'
require_gem 'Rmagic'

I get
c:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:121:in `activate':
(Gem::LoadError)
RubyGem version error: RMagick(1.6.0 not > 0.0.0)
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:34:in
`require_gem'
from C:/ruby/lib/ruby/gems/1.8/gems/RMagick-win32-1.6.0-mswin32/doc/ex/border.rb:6

I can copy the rmgic.rb and rmaigic.so to C:\ruby\lib\ruby\1.8 and the
samples work.

Thanks

Paul
2 Answers

Kaspar Schiess

11/29/2004 4:08:00 PM

0

paul.rogers@shaw.ca (Paul) wrote in news:4ee21163.0411290705.1d0e75b1
@posting.google.com:

> Im very confused by whats happening with rmagic and rubygem. Now, Im
> the first to admit that i didnt read much in the way of the
> installation instructions.

Hello Paul,

There seems to be an interaction between new rubygem code and an old gem:
The only sequence that really works good is

require 'rubygems'
require 'rmagick'

or more simply

in the shell:
set RUBYOPT=rubygems

in the script:
require 'rmagick'

Any combination of require_gem will fail, since the gem seems not to
respond properly to version questions.

There is code to assure backwards compatibility with gems that are not
compiled using the latest version of rmagick, but that code seems to be
broken.

Hope the above works for you.
kaspar

hand manufactured code - www.tua.ch/ruby



Kaspar Schiess

11/29/2004 4:11:00 PM

0

Kaspar Schiess <eule@space.ch> wrote in news:Xns95B0AEA88B5E0eulespacech@
80.91.229.5:

> There is code to assure backwards compatibility with gems that are not
> compiled using the latest version of rmagick, but that code seems to be
> broken.

sub! /latest version of rmagick/, 'latest version of rubygems'

.. of course ..

--
kaspar

hand manufactured code - www.tua.ch/ruby