Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread

 

By: Tim Hunter
RE: RMagick-win32 - NoMethodErrors (gems faul [ reply ]  
2007-09-18 13:52
Excellent! Thanks for posting. The only way I can tell if the release is fit for production is for people to tell me that it works.

By: Mike Woodhouse
RE: RMagick-win32 - NoMethodErrors (gems faul [ reply ]  
2007-09-18 13:05
"If you decide to install this version let me hear from you EVEN WHEN IT'S SUCCESSFUL!"

OK - I just updated to the 1.15.9 version and everything works. Woohoo!

This was with gems v0.9.4 and Ruby 1.8.6-25. I'd previously had most of the problems described below and I just got my first Gruff graph to display via Rails, which was ridiculously exciting. I really should get out more.

Mike

By: Tim Hunter
RE: RMagick-win32 - NoMethodErrors (gems faul [ reply ]  
2007-09-17 10:57
Which version? 1.14.1 or 1.15.9?

By: Sergey Gleizer
RE: RMagick-win32 - NoMethodErrors (gems faul [ reply ]  
2007-09-17 01:53
I downloaded and tried to install the 1.8.6 version; it still has the dirs in the backward order - got the 'NoMethodErrors' with rubygems 0.9.2


By: Matthias Reitinger
RE: RMagick-win32 - NoMethodErrors (gems faul [ reply ]  
2007-09-03 15:29
I've just installed the new gem on my Windows XP machine (running Ruby 1.8.6 with RubyGems 0.9.4). Everything seems to be working as intended now.

Thanks for updating the gem! I'm glad I could be of help.

By: Tim Hunter
RE: RMagick-win32 - NoMethodErrors (gems faul [ reply ]  
2007-09-03 14:22
Okay, I've uploaded a new release with this fix. This is the ONLY change from the previous release. I simply downloaded the existing version, changed the gemspec, re-built the gem and re-zipped the files.

I tested it with RubyGems 0.9.4 and it appears to be working. At least none of the "NoMethodError" problems reported in this thread occur.

If you decide to install this version let me hear from you EVEN WHEN IT'S SUCCESSFUL! Post on this thread or drop me a line at rmagick AT rubyforge DOT org.

Thanks to Matthias for finding the problem and suggesting the fix.

By: Tim Hunter
RE: RMagick-win32 - NoMethodErrors (gems faul [ reply ]  
2007-08-25 15:52
I think you nailed it! Plus it's an easy fix. Now that I have my own WinXP machine I can try to make the change myself. I'm out of town until next weekend but when I get back I'll give it a shot.

Thanks, Jan!

By: Matthias Reitinger
RE: RMagick-win32 - NoMethodErrors (gems faul [ reply ]  
2007-08-24 14:56
I think I found a fix. The metadata file of the RMagick 1.14.1 binary gem lists the require_paths in the following order:

require_paths:
- ext
- lib

Changing this to

require_paths:
- lib
- ext

fixes the problem. That's because RubyGems adds the library directories to $: (library search path) in the order given by require_paths. If the ext directory precedes the lib directory, RMagick.so (which resides in ext) is the first match when requiring RMagick and gets loaded. So switching the order of require_paths fixes the problem.

By: Tim Hunter
RE: RMagick-win32 - NoMethodErrors (gems faul [ reply ]  
2007-08-23 22:14
I wonder if RubyGems is searching the directory that contains the .so files before it searches the directory that contains .rb files. In "plain" Ruby the .rb files are installed in a different directory than the .so files. The .rb directory precedes the .so directory in Ruby's search path.

Typically scripts require just plain "RMagick". The RMagick.rb file explicitly requires "RMagick.so". The expectation is that Ruby will search for "RMagick", find "RMagick.rb", and then RMagick.rb will require RMagick.so. This works if Ruby searches the directories that contain .rb files before searching the directories that contain .so files.

If RubyGems finds RMagick.so first, then it would never find RMagick.rb.

Ruby, at least since 1.6.7, always finds the .rb file first. It does so currently. If RubyGems changes the search order, then it seems like any extension that has both an .rb and a .so file with the same name must fail.

By: Matthias Reitinger
RE: RMagick-win32 - NoMethodErrors (gems faul [ reply ]  
2007-08-23 12:44
> From what i can gather it seems like the ruby added class methods arn't being attached to the objects for some reason.
Exactly. require 'RMagick' only requires RMagick.so, but ignores RMagick.rb:

>>>>> Console Protocol >>>>>
D:\>irb -rubygems
irb(main):001:0> require 'RMagick'
=> true
irb(main):002:0> $".grep /RMagick/
=> ["RMagick.so"]
irb(main):003:0> Magick::Draw.new.scale
NoMethodError: undefined method `scale' for (no primitives defined):Magick::Draw
from (irb):3
irb(main):004:0> require 'RMagick.rb'
=> true
irb(main):005:0> $".grep /RMagick/
=> ["RMagick.so", "RMagick.rb"]
irb(main):006:0> Magick::Draw.new.scale
ArgumentError: wrong number of arguments (0 for 2)
from (irb):6:in `scale'
from (irb):6
irb(main):007:0>
>>>>> EOCP >>>>>

Now we just have to find out what change in Rubygems lead to this behaviour. Meanwhile a temporary fix would be to use require 'RMagick.rb' instead of require 'RMagick'. Not sure if this breaks compatibility with other platforms, though.

By: Mikael Rudberg
RE: RMagick-win32 - NoMethodErrors (gems faul [ reply ]  
2007-07-21 10:44
From what i can gather it seems like the ruby added class methods arn't being attached to the objects for some reason.

Like the following code


require 'RMagick'

img = Magick::Image.read('flip.jpg').first
^-- ( This works fine native .dll function i guess )
img.color_point(0,0,0)
^-- Results in following exception
Exception `NoMethodError' at test.rb:4 - undefined method `color_point' for flip
.jpg JPEG 200x250 200x250+0+0 DirectClass 8-bit 9kb:Magick::Image


By: Tim Hunter
RE: RMagick-win32 - NoMethodErrors (gems faul [ reply ]  
2007-07-13 19:42
I don't understand what you're describing here. Can you post a simple reproduction and explain what you're expecting and what you're actually experiencing? Just Ruby and RMagick. I'll check it out.

By: Tim Hunter
RE: RMagick-win32 - NoMethodErrors (gems faul [ reply ]  
2007-07-12 21:37
The RMagick gem for Windows is produced by volunteers. If you know of anybody who is willing to do this work please let me know.

By: Mikael Rudberg
RE: RMagick-win32 - NoMethodErrors (gems faul [ reply ]  
2007-07-12 21:28
I forgot to mention when i try to single step in the ruby debugger the Draw.new function exits

def reset_themes
@color_index = 0
@labels_seen = {}
@theme_options = {}

Before this line the variable @d is null
--> @d = Draw.new
After this line the variable @d, object, (no primitives defined)

Can it be some namespace conflicts going on as i can't see why it wouldn't single step into the Draw constructor being ruby code.

By: Mikael Rudberg
RE: RMagick-win32 - NoMethodErrors (gems faul [ reply ]  
2007-07-12 21:09
Is there any update on progress in this matter, i have exactly the same problem and i would like to avoid to revert gem to an older version if possible?

By: Jan Habermann
RE: RMagick-win32 - NoMethodErrors (gems faul [ reply ]  
2007-06-17 15:39
I contacted one of the guys at RubyGems...

You could do testing in a virtual machine couldn't you? ;)

By: Tim Hunter
RE: RMagick-win32 - NoMethodErrors (gems fault ;) [ reply ]  
2007-06-17 12:52
Hi Jan,

I've heard from other people about this problem. As far as I know, it's a RubyGems problem and has nothing to do with RMagick. I don't have a Windows PC so I can't do any diagnostics. I'm hoping that somebody else can do this and file a bug report with the RubyGems project.

By: Jan Habermann
RMagick-win32 - NoMethodErrors (gems fault ;) [ reply ]  
2007-06-17 09:04
Okay I am using the One-Click Installer for Ruby on Windows XP...and discovered the following weirdness:

RMagick (binary gem 1.14.1) does not work and gives method not found "cur_image" runtime errors. It does however work with gem-version 0.9.2 ... if you update to 0.9.4 it will throw these errors. I tested 0.9.3 also, doesn't work either...
So it might be a zLib problem dealing with the source cache or something...not sure...
But rubygems somehow messed things up on Windows ;)

Hope this will get fixed somehow or I can fix it (which i believe i can't, but who knows)...

Jan