[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Ruby can't see RMagick installed from gem on FC4

Lance Squire

8/2/2006 2:41:00 PM

I'm planning on using RMagick to do thumbnails for a Rails project.

Installed RMagick using 'gem install rmagick'

Here are last few lines...
--------------------------------------------------------------------------
gcc -fPIC -Wall -g -I. -I/usr/lib/ruby/1.8/i386-linux
-I/usr/lib/ruby/1.8/i386-linux
-I/usr/lib/ruby/gems/1.8/gems/rmagick-1.13.0/ext/RMagick
-DRUBY_VERSION=0x184 -I/usr/include -c rmfill.c
gcc -fPIC -Wall -g -I. -I/usr/lib/ruby/1.8/i386-linux
-I/usr/lib/ruby/1.8/i386-linux
-I/usr/lib/ruby/gems/1.8/gems/rmagick-1.13.0/ext/RMagick
-DRUBY_VERSION=0x184 -I/usr/include -c rminfo.c
gcc -fPIC -Wall -g -I. -I/usr/lib/ruby/1.8/i386-linux
-I/usr/lib/ruby/1.8/i386-linux
-I/usr/lib/ruby/gems/1.8/gems/rmagick-1.13.0/ext/RMagick
-DRUBY_VERSION=0x184 -I/usr/include -c rmmain.c
gcc -shared -L/usr/lib -lfreetype -lz -L/usr/lib -L"/usr/lib" -o
RMagick.so rmilist.o rmdraw.o rmutil.o rmimage.o rmfill.o rminfo.o
rmmain.o -lMagick -llcms -ltiff -lfreetype -ljpeg -lgs -lXext -lSM -lICE
-lX11 -lXt -lbz2 -lz -lpthread -lm -lpthread -lruby -ldl -lcrypt -lm
-lc
make[1]: Leaving directory
`/usr/lib/ruby/gems/1.8/gems/rmagick-1.13.0/ext/RMagick'
setup.rb: entering post-setup phase...
post-setup.rb: setting up documentation...
/usr/bin/ruby -I /usr/lib/ruby/gems/1.8/gems/rmagick-1.13.0/./lib -I
/usr/lib/ruby/gems/1.8/gems/rmagick-1.13.0/./ext/RMagick Adispatch.rb
/usr/bin/ruby -I /usr/lib/ruby/gems/1.8/gems/rmagick-1.13.0/./lib -I
/usr/lib/ruby/gems/1.8/gems/rmagick-1.13.0/./ext/RMagick
InitialCoords.rb
post-setup.rb: InitialCoords.rb example returned error code 256
/usr/bin/ruby -I /usr/lib/ruby/gems/1.8/gems/rmagick-1.13.0/./lib -I
/usr/lib/ruby/gems/1.8/gems/rmagick-1.13.0/./ext/RMagick NewCoordSys.rb
post-setup.rb: NewCoordSys.rb example returned error code 256
/usr/bin/ruby -I /usr/lib/ruby/gems/1.8/gems/rmagick-1.13.0/./lib -I
/usr/lib/ruby/gems/1.8/gems/rmagick-1.13.0/./ext/RMagick OrigCoordSys.rb
post-setup.rb: OrigCoordSys.rb example returned error code 256
/usr/bin/ruby -I /usr/lib/ruby/gems/1.8/gems/rmagick-1.13.0/./lib -I
/usr/lib/ruby/gems/1.8/gems/rmagick-1.13.0/./ext/RMagick
PreserveAspectRatio.rb
post-setup.rb: PreserveAspectRatio.rb example returned error code 256
/usr/bin/ruby -I /usr/lib/ruby/gems/1.8/gems/rmagick-1.13.0/./lib -I
/usr/lib/ruby/gems/1.8/gems/rmagick-1.13.0/./ext/RMagick RotateScale.rb
post-setup.rb: RotateScale.rb example returned error code 256

make install
/usr/bin/ruby setup.rb install

post-install.rb: installing documentation...
Successfully installed rmagick-1.13.0
------------------------------------------------------------------------

'post-setup.rb' error codes worry me...

Tried using it anyway as installation reported as 'successful' anyway.

Rails complained about not finding the methods.

tried testing the "require 'RMagick'" in irb.

------
LoadError: no such file to load -- RMagick
from (irb):1:in `require'
from (irb):1
------

tried the sample script from the 'Users Guide'
------
require 'RMagick'
include Magick

cat = ImageList.new("Cheetah.jpg")
cat.display
exit
-------

Results:
-------
Rmagicktest.rb:1:in `require': no such file to load -- RMagick
(LoadError)
from Rmagicktest.rb:1
-------

Checked locations of Rmagick.so and libMagick.so

-------
locate RMagick.so
/usr/lib/ruby/gems/1.8/gems/rmagick-1.13.0/ext/RMagick/RMagick.so
/usr/lib/ruby/gems/1.8/gems/rmagick-1.13.0/lib/RMagick.so
locate libMagick.so
/usr/lib/libMagick.so
/usr/lib/libMagick.so.9
/usr/lib/libMagick.so.9.0.4
-------

No 'usr/local/lib/ to worry about...

Any ideas on where to look/ how to fix?

Thanks,

Lance F. Squire

--
Posted via http://www.ruby-....

29 Answers

Justin Collins

8/2/2006 5:19:00 PM

0

Lance Squire wrote:
> I'm planning on using RMagick to do thumbnails for a Rails project.
>
> Installed RMagick using 'gem install rmagick'
>
>
>
<snip lots of stuff>
> Results:
> -------
> Rmagicktest.rb:1:in `require': no such file to load -- RMagick
> (LoadError)
> from Rmagicktest.rb:1
> -------
>
> Checked locations of Rmagick.so and libMagick.so
>
> -------
> locate RMagick.so
> /usr/lib/ruby/gems/1.8/gems/rmagick-1.13.0/ext/RMagick/RMagick.so
> /usr/lib/ruby/gems/1.8/gems/rmagick-1.13.0/lib/RMagick.so
> locate libMagick.so
> /usr/lib/libMagick.so
> /usr/lib/libMagick.so.9
> /usr/lib/libMagick.so.9.0.4
> -------
>
> No 'usr/local/lib/ to worry about...
>
> Any ideas on where to look/ how to fix?
>
> Thanks,
>
> Lance F. Squire
>

If you are using a library installed with gems, you will need to

require 'rubygems'

first. Give that a try.

-Justin

Anatol Pomozov

8/2/2006 7:28:00 PM

0

Lance Squire wrote:
> ------
> LoadError: no such file to load -- RMagick
> from (irb):1:in `require'
> from (irb):1
> ------
>
> tried the sample script from the 'Users Guide'
> ------
> require 'RMagick'
> include Magick
>
> cat = ImageList.new("Cheetah.jpg")
> cat.display
> exit
> -------
>
> Results:
> -------
> Rmagicktest.rb:1:in `require': no such file to load -- RMagick
> (LoadError)
> from Rmagicktest.rb:1
> -------
>
> Checked locations of Rmagick.so and libMagick.so
>
> -------
> locate RMagick.so
> /usr/lib/ruby/gems/1.8/gems/rmagick-1.13.0/ext/RMagick/RMagick.so
> /usr/lib/ruby/gems/1.8/gems/rmagick-1.13.0/lib/RMagick.so
> locate libMagick.so
> /usr/lib/libMagick.so
> /usr/lib/libMagick.so.9
> /usr/lib/libMagick.so.9.0.4
> -------
>
> No 'usr/local/lib/ to worry about...
>
> Any ideas on where to look/ how to fix?
>
> Thanks,
>
> Lance F. Squire

Try to run following line
ruby -rrubygems -e "require 'RMagick'; puts Magick::Long_version;"
what do you see??

Also you could read this article - you could find some interesting
things about RMagick

http://blog.pomozov.info/posts/adventure-with-rmagick-and-mo...

--
Posted via http://www.ruby-....

Lance Squire

8/2/2006 7:35:00 PM

0

Anatol Pomozov wrote:

> Try to run following line
> ruby -rrubygems -e "require 'RMagick'; puts Magick::Long_version;"
> what do you see??
>
> Also you could read this article - you could find some interesting
> things about RMagick
>
> http://blog.pomozov.info/posts/adventure-with-rmagick-and-mo...

$ ruby -rrubygems -e "require 'RMagick'; puts Magick::Long_version;"
This is RMagick 1.13.0 ($Date: 2006/06/26 23:32:37 $) Copyright (C) 2006
by Timothy P. Hunter
Built with ImageMagick 6.2.5 05/25/06 Q16
file:/usr/share/ImageMagick-6.2.5/doc/index.html
Built for ruby 1.8.4 (2005-12-24) [i386-linux]
Web page: http://rmagick.rub...
Email: rmagick@rubyforge.org

--------
Interesting.... That seems to work....

Reading website...

--
Posted via http://www.ruby-....

Lance Squire

8/2/2006 7:53:00 PM

0

Anatol Pomozov wrote:

> Also you could read this article - you could find some interesting
> things about RMagick
>
> http://blog.pomozov.info/posts/adventure-with-rmagick-and-mo...

Um... This is FC4 no sudo to worry about (there is a root account to
work from)

libs ARN'T in 'usr/local/lib' they are in 'usr/lib' (see top)

Running the irb or ruby tests above produce the same results under root.

Still stumped...

Lance

--
Posted via http://www.ruby-....

Ara.T.Howard

8/2/2006 7:57:00 PM

0

Anatol Pomozov

8/2/2006 10:04:00 PM

0

Lance Squire wrote:
> Anatol Pomozov wrote:
>
>> Try to run following line
>> ruby -rrubygems -e "require 'RMagick'; puts Magick::Long_version;"
>> what do you see??
>>
>> Also you could read this article - you could find some interesting
>> things about RMagick
>>
>> http://blog.pomozov.info/posts/adventure-with-rmagick-and-mo...
>
> $ ruby -rrubygems -e "require 'RMagick'; puts Magick::Long_version;"
> This is RMagick 1.13.0 ($Date: 2006/06/26 23:32:37 $) Copyright (C) 2006
> by Timothy P. Hunter
> Built with ImageMagick 6.2.5 05/25/06 Q16
> file:/usr/share/ImageMagick-6.2.5/doc/index.html
> Built for ruby 1.8.4 (2005-12-24) [i386-linux]
> Web page: http://rmagick.rub...
> Email: rmagick@rubyforge.org
>
> --------
> Interesting.... That seems to work....
>
> Reading website...


Add explicit
require 'rebygems'
to your code then


require 'rubygems'
require 'RMagick'
include Magick
cat = ImageList.new("Cheetah.jpg")
cat.display
exit

--
Posted via http://www.ruby-....

Lance Squire

8/4/2006 2:05:00 PM

0

Justin Collins wrote:
>
> If you are using a library installed with gems, you will need to
>
> require 'rubygems'
>
> first. Give that a try.
>
> -Justin

This dose make the test code from the 'Users guide' work.

Though you would think they would have included it....

Lance

--
Posted via http://www.ruby-....

Lance Squire

8/4/2006 2:06:00 PM

0

Justin Collins wrote:
> require 'rubygems'
>
> first. Give that a try.
>
> -Justin

Unfortunatly, no love from rails...

Lance

--
Posted via http://www.ruby-....

Lance Squire

8/4/2006 2:12:00 PM

0

unknown wrote:
>
> you should never, never compile as root. fyi.
>

Yes, but I must 'su' for the 'gem install rmagick' to work properly.

>>
>> libs ARN'T in 'usr/local/lib' they are in 'usr/lib' (see top)
>
> and do you have ld.so configured to look there?
>

Well, as Rails is working properly, and was installed the same way, I
presume that ld.so is pointing to 'usr/lib'

Can't find relevent ld.so to check...

# locate ld.so
/etc/ld.so.cache
/etc/ld.so.conf
/etc/ld.so.conf.d
/etc/ld.so.conf.d/mysql-i386.conf
/etc/ld.so.conf.d/qt-i386.conf
/usr/lib/librpmbuild.so
/usr/lib/kde3/kded_kssld.so
/usr/share/doc/man-pages-ja-20060115/translation_lists/ld.so.translation_list
/usr/share/man/ja/man8/ld.so.8.gz
/usr/share/man/man8/ld.so.8.gz

Lance

--
Posted via http://www.ruby-....

Ara.T.Howard

8/4/2006 2:29:00 PM

0