cancel
Showing results for 
Search instead for 
Did you mean: 

Ruby - ActiveRecord

Former Member
0 Kudos
2,480

Hello,

can somebody help me? Where is my Misstake? Running is the Example-PersonalServer of the Standard-Installation.

require 'rubygems'
require 'active_record'

ActiveRecord::Base.establish_connection(adapter: "sqlanywhere", database: "demo", user: "DBA", password: "***", server: "demo12")

class Contacts < ActiveRecord::Base
  self.table_name = 'Contacts'
end

res = Contacts.find(:all)

Error: in `build_arel': undefined method `bind_values' for #<Arel::SelectManager:0x270faf8> (NoMethodError)


I use: activerecord (4.1.8) activerecord-sqlanywhere-adapter (1.0.0) arel (5.0.0) sqlanywhere (0.1.6)

Thx, Pascal

Former Member
0 Kudos

how can i load the arel-visitor for sqlanywhere? i think, there ist my problem:

require 'rubygems'
require 'active_record'
require 'active_record/connection_adapters/abstract_adapter'
require 'active_record/connection_adapters/sqlanywhere_adapter'

ActiveRecord::Base.establish_connection(adapter: "sqlanywhere", database: "demo", user: "DBA", password: "***", server: "demo12")
ActiveRecord::Base.connection

class Contact < ActiveRecord::Base
end

Contact.select('id')

Error-Message:
...in `to_sql': undefined method `accept' for nil:NilClass (NoMethodError)

Thanks, Pascal

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

I use another gem that works perfectly with SQLAnywhwere:

gem 'activerecord-sqlanywhere-adapter', :git => 'git://github.com/Sharagoz/activerecord-sqlanywhere-adapter.git', :branch => 'rails40'

Just put the line above in the gem file, run bundle install, configure database.yml correctly and go.