Bugs: Browse | Submit New | Admin

[#2297] undefined method 'create' for class 'Class'

Date:
2005-08-24 13:58
Priority:
3
Submitted By:
Tim Smith (tsmith)
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
undefined method 'create' for class 'Class'

Detailed description
On Windows XP with ruby 1.8.2 (2004-12-25) [i386-mswin32] and Ruby/SerialPort 0.6, I get the error below when running
my file test.rb.

=== test.rb ===

require "serialport"

port = SerialPort.new "COM1"

===============

(eval):1: (eval):1:in `private_class_method': undefined method `create' for class `Class' (NameError)
	from (eval):1
	from c:/program files/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require'
	from test.rb:1

Add A Comment: Notepad

Please login


Followup

Message
Date: 2009-05-31 19:39
Sender: James Maki

try using:

require 'serialport.rb'
Date: 2008-01-15 20:55
Sender: James Tucker

Line 1281 of serialport.c can be patched to read:

	  "private_class_method(:create) if
defined?(create())\n"

And this will work properly on 1.8.6 (and I believe 1.8.2?) with
rubygems.

Date: 2007-04-07 09:27
Sender: Mikko Peltonen

Here's a patch that resolves this problem (at least for me it
did :-): https://rubyforge.org/tracker/index.php?func=detail&
aid=9923&group_id=61&atid=321
Date: 2006-11-04 04:09
Sender: Tony Buser

I ran into the same error when rubygems is required.  I was able
to get around the problem by bypassing rubygem's custom require
like this:

require "rubygems"
Kernel::require "serialport"
Date: 2006-05-03 05:02
Sender: David Middleton

I get the same under linux:

irb(main):001:0> require 'serialport'
NameError: (eval):1:in `private_class_method': undefined method
`create' for class `Class'
        from (eval):1
        from (eval):1
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.
rb:21:in `require'
        from (irb):1
Date: 2005-10-11 13:57
Sender: Nobody

I get the same error. What to say is that i use the pre-compiled
version ; i tried to compile the sources with microsoft C compiler
from visual Studio .NET but the Microsoft "make" program
seems to by disturbed by the Makefile syntax.

As I don't know about Microsoft compiling toolchain, i'll try
to install GNU make and try it again.

Lionel ORRY

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item