Computer Science Canada

RMagick

Author:  Jerrik [ Mon Dec 10, 2007 4:10 pm ]
Post subject:  RMagick

I installed RMagick but I get an error.

code:
require 'RMagick'

Produces
code:
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- RMagick (LoadError)
        from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'


I tried updating my gems (gems --system). I googled the crap out of the error, and all I got was to put (require 'rubygems') because I'm not using Ruby on Rails (I'm using SciTE).

If anyone could point me in the right direction I'd appreciate it.

Author:  Tony [ Mon Dec 10, 2007 4:59 pm ]
Post subject:  RE:RMagick

updating the gems will only update what you already have
code:

gems --list

you should get the gem first
code:

gem install rmagick

though, more specifically, it might be rmagick-win32, since it looks like you're using Windows.

Also... Ruby on Rails is a software framework, while SciTE is a text editor... so not sure what you are trying to say there.

Author:  Jerrik [ Mon Dec 10, 2007 10:03 pm ]
Post subject:  Re: RE:RMagick

Tony @ Mon Dec 10, 2007 4:59 pm wrote:
updating the gems will only update what you already have
code:

gems --list

you should get the gem first
code:

gem install rmagick

though, more specifically, it might be rmagick-win32, since it looks like you're using Windows.

Also... Ruby on Rails is a software framework, while SciTE is a text editor... so not sure what you are trying to say there.


I've never used RoR but I read that it does a lot for you. In terms of RMagick it inserts "require 'rubygems'" so you don't have to write that in your programs (It was one of the errors I found so I thought I'd mention RoR here).

When I try
code:

gem install rmagick

I get this;

code:

C:\WINDOWS>gem install rmagick
Building native extensions.  This could take a while...
ERROR:  Error installing rmagick:
        ERROR: Failed to build gem native extension.

c:/ruby/bin/ruby.exe gem_extconf.rb install rmagick

sh configure

configure[53]: chmod: not found
configure[53]: chmod: not found
configure[465]: expr: not found
configure[465]: chmod: not found
configure: error: cannot create configure.lineno; rerun with a POSIX shell
RMagick configuration failed with status 1.


Gem files will remain installed in c:/ruby/lib/ruby/gems/1.8/gems/rmagick-1.15.1
1 for inspection.
Results logged to c:/ruby/lib/ruby/gems/1.8/gems/rmagick-1.15.11/gem_make.out

I removed rmagick and it installed it, but still gave the same message.

It also doesn't show rmagick in my list of Ruby gems, which doesn't make any sense to me because I can see the folders for two versions of RMagick;

C:\WINDOWS>gem list

*** LOCAL GEMS ***

code:
fxri (0.3.6)
fxruby (1.6.12)
hpricot (0.6)
log4r (1.0.5)
rake (0.7.3)
rubygems-update (0.9.5)
sources (0.0.1)
win32-api (1.0.0)
win32-clipboard (0.4.3)
win32-dir (0.3.2)
win32-eventlog (0.4.6)
win32-file (0.5.4)
win32-file-stat (1.2.5)
win32-process (0.5.3)
win32-sapi (0.1.4)
win32-sound (0.4.1)
windows-api (0.2.0)
windows-pr (0.7.1)


I'm fairly new to Ruby, so I don't doubt I messed something up.

Author:  Clayton [ Mon Dec 10, 2007 10:06 pm ]
Post subject:  RE:RMagick

Try:

code:
>>gem install rmagick-win32


And see if that helps. It may be you're trying to install software not meant for a win32 platform.

Author:  Tony [ Mon Dec 10, 2007 10:10 pm ]
Post subject:  Re: RE:RMagick

Jerrik @ Mon Dec 10, 2007 10:03 pm wrote:
I don't doubt I messed something up.

You have. You're running Windows. So it can't properly configure RMagick.

As I've mentioned at first (and as Clayton is pointing out), rmagick-win32 might be the variation that you're looking for.

Author:  Clayton [ Mon Dec 10, 2007 10:16 pm ]
Post subject:  RE:RMagick

Tony wrote:
As I've mentioned at first...

So you did, my apologies.

Author:  Jerrik [ Mon Dec 10, 2007 10:41 pm ]
Post subject:  Re: RMagick

code:
C:\WINDOWS>gem install rmagick-win32
ERROR:  could not find rmagick-win32 locally or in a repository


I originally installed rmagick from here http://rubyforge.org/projects/rmagick/ and I used the rmagick-win32 download.

I tried gem install rmagick-win32 as well after I read tony's post but it didn't work, or I messed it up. Thanks for the help so far though ^_^

Author:  Tony [ Mon Dec 10, 2007 11:05 pm ]
Post subject:  RE:RMagick

I think the installer should have came with additional instructions in a readme file

Author:  Jerrik [ Tue Dec 11, 2007 12:53 am ]
Post subject:  Re: RMagick

I got it to work, thank you for all the help. The problem was that didn't have my Command Prompt set to the right director, so it couldn't find rmagick in order to install it.

Thanks again.

EDIT: Display, Capture, and Animate apparently don't work for windows. Does anyone know a way to display images in Ruby? It was the main reason for getting RMagick.


: