Forums | Admin

Discussion Forums: open-discussion

Start New Thread Start New Thread

 

By: Qi Zhang
RE: undefined method `cattr_accessor' [ reply ]  
2008-06-10 07:19
Hi Praveen Devarao,
Thanks a lot for your so detail and quick feedback. :)

By: Qi Zhang
RE: undefined method `cattr_accessor' [ reply ]  
2008-06-10 07:18
wait...
it works with:
require 'mswin32/ibm_db'

Close this thread.

By: Praveen Devarao
RE: undefined method `cattr_accessor' [ reply ]  
2008-06-10 07:17
Hi Qi,

Please do, require 'mswin32/ibm_db' and not require 'ibm_db'. The require statement that you have issued is for Linux and Unix platforms only. For windows platforms please use require 'mswin32/ibm_db'. This is because the .so file resides in \lib\mswin32 directory, which is not the case for other platforms where the .so file can be seen in the \lib\ directory itself.

Thank You
Praveen

By: Qi Zhang
undefined method `cattr_accessor' [ reply ]  
2008-06-10 07:02
I got the following errors when I perform require 'ibm_db' in irb:
irb#1(main):001:0> require "ibm_db"
NoMethodError: undefined method `cattr_accessor' for ActiveRecord::Base:Class
from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record
/connection_adapters/abstract/connection_specification.rb:14
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `ge
m_original_require'
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `re
quire'
from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record
/connection_adapters/abstract_adapter.rb:10
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `ge
m_original_require'
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `re
quire'
from c:/ruby/lib/ruby/gems/1.8/gems/ibm_db-0.9.4-mswin32/lib/active_reco
rd/connection_adapters/ibm_db_adapter.rb:9
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `ge
m_original_require'
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `re
quire'
from c:/ruby/lib/ruby/gems/1.8/gems/ibm_db-0.9.4-mswin32/lib/ibm_db.rb:2

from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in `ge
m_original_require'
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in `re
quire'
from (irb#1):1
I'm working on WindowsXP sp2. ibm_db works in ROR project in my system.
And this is my current gem packages information:
*** LOCAL GEMS ***

actionmailer (2.0.2)
Service layer for easy email delivery and testing.

actionpack (2.0.2)
Web-flow and rendering framework putting the VC in MVC.

activerecord (2.0.2)
Implements the ActiveRecord pattern for ORM.

activeresource (2.0.2)
Think Active Record for web resources.

activesupport (2.0.2)
Support and utility classes used by the Rails framework.

fxri (0.3.6)
Graphical interface to the RI documentation, with search engine.

fxruby (1.6.12)
FXRuby is the Ruby binding to the FOX GUI toolkit.

hpricot (0.6)
a swift, liberal HTML parser with a fantastic library

ibm_db (0.9.4)
Rails Driver and Adapter for IBM Data Servers: {LUW, zOS, i5, IDS}

log4r (1.0.5)
Log4r is a comprehensive and flexible logging library for Ruby.

rails (2.0.2)
Web-application framework with template engine, control-flow layer,
and ORM.

rake (0.7.3)
Ruby based make-like utility.

sources (0.0.1)
This package provides download sources for remote gem installation

win32-api (1.0.4)
A superior replacement for Win32API

win32-clipboard (0.4.3)
A package for interacting with the Windows clipboard

win32-dir (0.3.2)
Extra constants and methods for the Dir class on Windows.

win32-eventlog (0.4.6)
Interface for the MS Windows Event Log.

win32-file (0.5.4)
Extra or redefined methods for the File class on Windows.

win32-file-stat (1.2.7)
A File::Stat class tailored to MS Windows

win32-process (0.5.3)
Adds fork, wait, wait2, waitpid, waitpid2 and a special kill method

win32-sapi (0.1.4)
An interface to the MS SAPI (Sound API) library.

win32-sound (0.4.1)
A library for playing with sound on MS Windows.

windows-api (0.2.0)
An easier way to create methods using Win32API

windows-pr (0.7.2)
Windows functions and constants bundled via Win32::API

Anybody know how can I handle it? Thanks a lot.