-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
class:Record does not compile, undefined method error #1
Comments
Hey @cclose, I ran into a similar problem, I was trying to use this gem with ruby-2.0 under Linux. A friend of mine recommended using an earlier version of Ruby (I see you're on 1.9.1), I ran it under OS X (10.6.8 ruby-1.8.3) and it runs OK. Something very strange, I'm a ruby noob but my code only seems to work properly with irb (vs /usr/bin/ruby). If it's running against /usr/bin/ruby it says it can't find adt ... probably a path issue. shrug I see @chasemgray posted some schematics on his website regarding the file format, I would like to create a Python or Perl package to deal with these files but I don't have much free time or skills ... but maybe someday. Anyways, good luck! |
I haven't really kept up with this gem. I will try to take a look though and make sure it at least works with the latest version of Ruby. |
Hi Chase, Thanks for contacting me, That would be great if you have the time to work on that, I think I'll Take care, and I really enjoyed reading your blog (after grimacing a bit). John On 13 April 2013 22:04, Chase Gray [email protected] wrote:
|
I have a workaround that will allow this gem to be used with Ruby 1.9.3 on Windows. Haven't tried it on OSX or Linux so your mileage may vary. But here's what I had to do... In the "record.rb" file included with the ruby-adt gem, after the module declaration add
Then, inside the Record class add
Then change the line "delegate :columns, :to => :@table" to the following
That should do it. If, after making these changes, you get a method undefined error for the underscore method, add the following after your "require 'forwardable'" statement (obviously, you'll have to install activesupport if you don't already have it).
Hope this helps. Let me know how it works for you. Now if I could just figure out how to correctly unpack advantage date fields with this gem, I'll be set. |
I downloaded your gem ruby-adt 0.5.0 for use with ruby 1.9.3 and tried to use, but I receive a compile error "undefined method 'delegate'".
I'm not even trying to use it yet, i've simply added "require 'adt'" to the top of my (otherwise empty) file. The exact error received is:
ruby readAdt.rb
'/home/xes/.rvm/gems/ruby-1.9.3-p385/gems/ruby-adt-0.5.0/lib/adt/record.rb:8:in
<class:Record>': undefined method
delegate' for ADT::Record:Class (NoMethodError)from /home/xes/.rvm/gems/ruby-1.9.3-p385/gems/ruby-adt-0.5.0/lib/adt/record.rb:5:in
<module:ADT>' from /home/xes/.rvm/gems/ruby-1.9.3-p385/gems/ruby-adt-0.5.0/lib/adt/record.rb:3:in
<top (required)>'from /home/xes/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
require' from /home/xes/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
require'from /home/xes/.rvm/gems/ruby-1.9.3-p385/gems/ruby-adt-0.5.0/lib/adt.rb:18:in
<top (required)>' from /home/xes/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in
require'from /home/xes/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in
rescue in require' from /home/xes/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in
require'from readAdt.rb:4:in `
Full source code is:
!/usr/bin/ruby
require 'rubygems'
require 'adt'
table = ADT::Table.new("messageinfo.adt")
table.each do |record|
end
puts "It worked!"
This is fresh install of ruby 1.9.3, using the rvm. The only gem i've installed is mysql2 and ruby-adt
The text was updated successfully, but these errors were encountered: