Hi, when trying to use ActiveRecord without Rails I am getting a
NoMethodError.
This is ActiveRecord 3.2.9.
Funny thing is the same code use to work with ActiveRecord 3.0.3
Been searching for possible clues for a while, think its time for a
post.
Anyhelp would be appreciated.
To Reproduce:
[delta@cdc002 lib]$ irb
irb(main):001:0> require ‘active_record’
=> true
irb(main):003:0> ActiveRecord::Base.establish_connection(
{“adapter”=>“oracle_enhanced” , “username”=>“nemo” ,
“password”=>“devilfish” , “database”=>“octopus” , “host”=>“octopus”
, “port”=>1521} )
NoMethodError: undefined method establish_connection' for ActiveRecord::Base:Class from /usr/local/delta/ruby.2012.11.15/lib/ruby/gems/1.9.1/gems/activerecord-3.2.9/lib/active_record/dynamic_matchers.rb:50:inmethod_missing’
from (irb):3
from /usr/local/delta/ruby/bin/irb:12:in `’
Environment: ( Linux )
[delta@cdc002 lib]$ ruby -v
ruby 1.9.1p431 (2011-02-18 revision 30908) [i686-linux]
[delta@cdc002 lib]$ gem -v
1.8.24
[delta@cdc002 lib]$ gem list
*** LOCAL GEMS ***
activemodel (3.2.9)
activerecord (3.2.9)
activerecord-oracle_enhanced-adapter (1.4.1)
activerecord-sqlserver-adapter (3.2.10)
activesupport (3.2.9)
arel (3.0.2)
builder (3.0.0)
daemons (1.1.9)
deprecated (3.0.1)
encryptor (1.1.3)
fastercsv (1.5.5)
gem_plugin (0.2.3)
i18n (0.6.1)
json (1.7.5)
json_pure (1.7.5)
minitest (4.2.0)
mktemp (0.0.1)
multi_json (1.3.7)
mysql (2.8.1)
needle (1.3.0)
net-scp (1.0.4)
net-sftp (2.0.5)
net-ssh (2.6.1)
railroad (0.5.0)
rake (10.0.1)
rdoc (3.12)
ruby-oci8 (2.1.3)
ruby-ole (1.2.11.5)
rubyforge (2.0.4)
rubyzip (0.9.9)
spreadsheet (0.7.4)
tiny_tds (0.5.1)
tzinfo (0.3.35)