`type_cast': undefined method `type_cast_from_database'
Opened this issue · 2 comments
Hi,
i create database on mongodb but is empty.
translation process have problem.
d:\angularWork\mongy>mongify process database.config translation.rb
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/mongify-1.3.0/lib/mongify/database/column.rb:246:in type_cast': undefined method
type_cast_from_database' for #ActiveRecord::Type::DateTime:0x000000053192a0 (NoMethodError) | ETA: --:--:--
Did you mean? type_cast_for_schema
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/mongify-1.3.0/lib/mongify/database/column.rb:128:in translate' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/mongify-1.3.0/lib/mongify/database/table.rb:133:in
block in translate'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/mongify-1.3.0/lib/mongify/database/table.rb:131:in each' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/mongify-1.3.0/lib/mongify/database/table.rb:131:in
translate'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/mongify-1.3.0/lib/mongify/translation/process.rb:33:in block (3 levels) in copy_data' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0.1/lib/active_record/result.rb:52:in
block in each'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0.1/lib/active_record/result.rb:52:in each' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0.1/lib/active_record/result.rb:52:in
each'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/mongify-1.3.0/lib/mongify/translation/process.rb:32:in block (2 levels) in copy_data' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/mongify-1.3.0/lib/mongify/database/sql_connection.rb:86:in
block in select_rows'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/core_ext/range/each.rb:5:in each' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/core_ext/range/each.rb:5:in
each'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/mongify-1.3.0/lib/mongify/database/sql_connection.rb:84:in select_rows' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/mongify-1.3.0/lib/mongify/translation/process.rb:29:in
block in copy_data'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/mongify-1.3.0/lib/mongify/translation/process.rb:28:in each' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/mongify-1.3.0/lib/mongify/translation/process.rb:28:in
copy_data'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/mongify-1.3.0/lib/mongify/translation/process.rb:14:in process' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/mongify-1.3.0/lib/mongify/cli/command/worker.rb:68:in
execute'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/mongify-1.3.0/lib/mongify/cli/application.rb:28:in execute!' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/mongify-1.3.0/bin/mongify:15:in
<top (required)>'
from C:/Ruby23-x64/bin/mongify:23:in load' from C:/Ruby23-x64/bin/mongify:23:in
--database.config----
sql_connection do
adapter "mysql2"
host "localhost"
username "root"
password "root"
database "laboratorio"
end
mongodb_connection do
host "localhost"
database "laboratorio"
end
Try uninstalling ActiveRecord 5.0.
I just released version 1.3.1
of Mongify which should lock down the gem requirements. Please install the latest version (gem install mongify
) and let me know if this issue still exists.