(我对 Rails 比较陌生)
我有一个文件(Ruby)我正在通过 Ironworker 运行/上传,该文件当前使用 MySql(activeRecord)作为数据库。一切正常,但我们现在需要一个新的(附加)模型,它将使用 Mongoid,它也将包含在我们上传到 IronWorker 的代码中。当我在 IronWorker 文件中包含以下行 merge_gem 'mongoid' 时,我得到:
弃用警告:不再需要为属性方法指定空前缀/后缀。如果调用时没有定义方法的无前缀/后缀版本
define_attribute_methods
,则会自动定义。(从 /usr/lib/ruby/gems/1.9.1/gems/activerecord-3.1.6/lib/active_record/attribute_methods/read.rb:9 的块调用)
弃用警告:同步已弃用,将从 Rails 3.2 中删除。(从 /usr/lib/ruby/gems/1.9.1/gems/activerecord-3.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:298 调用) 弃用警告:define_attr_method 已弃用,将被删除替代品。(从 /usr/lib/ruby/gems/1.9.1/gems/activerecord-3.1.6/lib/active_record/base.rb:660 处的 set_table_name 调用) 弃用警告:define_attr_method 已弃用,将被删除而无需替换。(从 /usr/lib/ruby/gems/1.9.1/gems/activerecord-3.1.6/lib/active_record/locking/optimistic.rb:150 的 set_locking_column 调用)/usr/lib/ruby/gems/1.9.1 /gems/activerecord-3.1.6/lib/active_record/attribute_methods/read.rb:82:indefine_read_method': uninitialized constant ActiveModel::AttributeMethods::COMPILABLE_REGEXP (NameError)
from /usr/lib/ruby/gems/1.9.1/gems/activerecord-3.1.6/lib/active_record/attribute_methods/read.rb:42:in
来自/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.1.6/lib/active_record/attribute_methods/time_zone_conversion.rb:35的define_method_attribute' define_method_attribute'
from /task/gems/activemodel/lib/active_model/attribute_methods.rb:267:in
:在/task/gems/activemodel/lib的define_attribute_method'块中/active_model/attribute_methods.rb:260:in each'
from /task/gems/activemodel/lib/active_model/attribute_methods.rb:260:in
define_attribute_method' from /task/gems/activemodel/lib/active_model/attribute_methods.rb:256:in block in define_attribute_methods'
from /task/gems/activemodel/lib/active_model/attribute_methods.rb:256:in
each' from /task/gems/activemodel/lib/active_model/attribute_methods.rb:256 :in define_attribute_methods'
from /usr/lib/ruby/gems/1.9.1/gems/activerecord-3.1.6/lib/active_record/attribute_methods.rb:14:in
define_attribute_methods' 来自 /usr/lib/ruby/gems/1.9.1/gems/activerecord-3.1.6/lib/active_record/attribute_methods.rb:65:in respond_to?'
from /task/gems/activesupport/lib/active_support/callbacks.rb:398:in
__run_callback' 来自 /task/gems/activesupport/lib/active_support /callbacks.rb:385:in_run_find_callbacks'
from /task/gems/activesupport/lib/active_support/callbacks.rb:81:in
run_callbacks' 来自 /usr/lib/ruby/gems/1.9.1/gems/activerecord-3.1.6/lib/active_record/base.rb:1617:in init_with'
from /usr/lib/ruby/gems/1.9.1/gems/activerecord-3.1.6/lib/active_record/base.rb:959:in
instantiate' 来自 /usr/lib/ruby/gems/1.9.1 /gems/activerecord-3.1.6/lib/active_record/base.rb:470:in block in find_by_sql'
from /usr/lib/ruby/gems/1.9.1/gems/activerecord-3.1.6/lib/active_record/base.rb:470:in
collect!' 来自 /usr/lib/ruby/gems/1.9.1/gems/activerecord-3.1.6/lib/active_record/base.rb:470:in find_by_sql'
from /usr/lib/ruby/gems/1.9.1/gems/activerecord-3.1.6/lib/active_record/relation.rb:112:in
to_a' 来自 /usr/lib/ruby/gems/1.9.1/gems /activerecord-3.1.6/lib/active_record/relation/finder_methods.rb:376:in find_first'
from /usr/lib/ruby/gems/1.9.1/gems/activerecord-3.1.6/lib/active_record/relation/finder_methods.rb:122:in
first' 来自 /usr/lib/ruby/gems/1.9.1/gems/activerecord-3.1.6/lib/active_record/relation/ finder_methods.rb:263:in find_by_attributes'
from /usr/lib/ruby/gems/1.9.1/gems/activerecord-3.1.6/lib/active_record/base.rb:1070:in
method_missing' from /task/user_setup.rb:74:in new_user_setup'
from /task/user_setup.rb:39:in
initialize' from /task/justa_worker.rb:48:in new'
from /task/justa_worker.rb:48:in
run' from /task/runner.rb:405:in `'