NoMethodError:未定义的方法`key_columns&#39; for#<class:0x00000007863dd0>

时间:2015-10-13 09:38:07

标签: ruby-on-rails ruby postgresql cassandra cequel

我是rails和cequel的新人。我已经在Postgres上创建了现有的模型女巫,现在我正试图将它迁移到Cassandra。 我只想迁移我的一个模特和其他我希望留在Postgres上。这可能吗?

我的模特:

class TripPoint
  include Cequel::Record
  belongs_to :trip
  key     :device_created_at, :timestamp
  key     :trip_points_id, :timeuuid, auto: true
  column  :rssi, :int
  ....
end

class Trip < ActiveRecord::Base
  has_many :trip_points

end

当我尝试运行时:rake cequel:migrate 我收到了错误:

rake aborted!
NoMethodError: undefined method `key_columns' for #<Class:0x00000007863dd0>
/home/zmagajna/.rvm/gems/ruby-2.1.2/gems/activerecord-4.1.10/lib/active_record/dynamic_matchers.rb:26:in `method_missing'
/home/zmagajna/.rvm/gems/ruby-2.1.2/gems/cequel-1.7.0/lib/cequel/record/associations.rb:117:in `belongs_to'
/home/zmagajna/Ruby/ULU/ulu-rails/app/models/trip_point.rb:10:in `<class:TripPoint>'
/home/zmagajna/Ruby/ULU/ulu-rails/app/models/trip_point.rb:1:in `<top (required)>'
/home/zmagajna/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.10/lib/active_support/dependencies.rb:443:in `load'
/home/zmagajna/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.10/lib/active_support/dependencies.rb:443:in `block in load_file'
/home/zmagajna/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.10/lib/active_support/dependencies.rb:633:in `new_constants_in'
/home/zmagajna/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.10/lib/active_support/dependencies.rb:442:in `load_file'
/home/zmagajna/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.10/lib/active_support/dependencies.rb:342:in `require_or_load'
/home/zmagajna/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.10/lib/active_support/dependencies.rb:307:in `depend_on'
/home/zmagajna/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.10/lib/active_support/dependencies.rb:225:in `require_dependency'
/home/zmagajna/.rvm/gems/ruby-2.1.2/gems/cequel-1.7.0/lib/cequel/record/tasks.rb:61:in `block in migrate'
/home/zmagajna/.rvm/gems/ruby-2.1.2/gems/cequel-1.7.0/lib/cequel/record/tasks.rb:55:in `each'
/home/zmagajna/.rvm/gems/ruby-2.1.2/gems/cequel-1.7.0/lib/cequel/record/tasks.rb:55:in `migrate'
/home/zmagajna/.rvm/gems/ruby-2.1.2/gems/cequel-1.7.0/lib/cequel/record/tasks.rb:21:in `block (2 levels) in <top (required)>'
/home/zmagajna/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `eval'
/home/zmagajna/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => cequel:migrate
(See full trace by running task with --trace)

我的环境: 红宝石2.1.2p95 Rails 4.1.10 cequel(= 1.7.0)

0 个答案:

没有答案