我最近更新到Rails 3.0.8.rc2,然后将paperclip gem更新为2.3.11(这也在2.3.10上失败)。在启动时,回形针宝石似乎没有注册:
/Users/jade/code/plantworking/app/models/comment.rb:17: undefined method `has_attached_file' for Comment:Class (NoMethodError)
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/activesupport-3.0.8.rc2/lib/active_support/dependencies.rb:454:in `load'
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/activesupport-3.0.8.rc2/lib/active_support/dependencies.rb:454:in `load_file'
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/activesupport-3.0.8.rc2/lib/active_support/dependencies.rb:596:in `new_constants_in'
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/activesupport-3.0.8.rc2/lib/active_support/dependencies.rb:453:in `load_file'
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/activesupport-3.0.8.rc2/lib/active_support/dependencies.rb:340:in `require_or_load'
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/activesupport-3.0.8.rc2/lib/active_support/dependencies.rb:300:in `depend_on'
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/activesupport-3.0.8.rc2/lib/active_support/dependencies.rb:216:in `require_dependency'
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/mongoid-2.0.2/lib/rails/mongoid.rb:55:in `load_model'
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/mongoid-2.0.2/lib/rails/mongoid.rb:18:in `load_models'
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/mongoid-2.0.2/lib/rails/mongoid.rb:17:in `each'
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/mongoid-2.0.2/lib/rails/mongoid.rb:17:in `load_models'
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/railties-3.0.8.rc2/lib/rails/paths.rb:102:in `each'
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/railties-3.0.8.rc2/lib/rails/paths.rb:102:in `each'
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/mongoid-2.0.2/lib/rails/mongoid.rb:16:in `load_models'
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/mongoid-2.0.2/lib/mongoid/railtie.rb:86:in `_callback_before_5'
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/activesupport-3.0.8.rc2/lib/active_support/callbacks.rb:420:in `_run_prepare_callbacks'
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/actionpack-3.0.8.rc2/lib/action_dispatch/middleware/callbacks.rb:40:in `initialize'
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/actionpack-3.0.8.rc2/lib/action_dispatch/middleware/stack.rb:33:in `new'
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/actionpack-3.0.8.rc2/lib/action_dispatch/middleware/stack.rb:33:in `build'
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/actionpack-3.0.8.rc2/lib/action_dispatch/middleware/stack.rb:79:in `build'
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/railties-3.0.8.rc2/lib/rails/application.rb:209:in `inject'
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/actionpack-3.0.8.rc2/lib/action_dispatch/middleware/stack.rb:79:in `each'
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/actionpack-3.0.8.rc2/lib/action_dispatch/middleware/stack.rb:79:in `inject'
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/actionpack-3.0.8.rc2/lib/action_dispatch/middleware/stack.rb:79:in `build'
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/railties-3.0.8.rc2/lib/rails/application.rb:162:in `build_middleware_stack'
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/railties-3.0.8.rc2/lib/rails/application/finisher.rb:35
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/railties-3.0.8.rc2/lib/rails/initializable.rb:25:in `instance_exec'
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/railties-3.0.8.rc2/lib/rails/initializable.rb:25:in `run'
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/railties-3.0.8.rc2/lib/rails/initializable.rb:50:in `run_initializers'
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/railties-3.0.8.rc2/lib/rails/initializable.rb:49:in `each'
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/railties-3.0.8.rc2/lib/rails/initializable.rb:49:in `run_initializers'
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/railties-3.0.8.rc2/lib/rails/application.rb:134:in `initialize!'
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/railties-3.0.8.rc2/lib/rails/application.rb:77:in `send'
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/railties-3.0.8.rc2/lib/rails/application.rb:77:in `method_missing'
from /Users/jade/code/plantworking/config/environment.rb:11
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/polyglot-0.3.1/lib/polyglot.rb:64:in `polyglot_original_require'
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/polyglot-0.3.1/lib/polyglot.rb:64:in `require'
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/activesupport-3.0.8.rc2/lib/active_support/dependencies.rb:239:in `require'
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/activesupport-3.0.8.rc2/lib/active_support/dependencies.rb:225:in `load_dependency'
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/activesupport-3.0.8.rc2/lib/active_support/dependencies.rb:596:in `new_constants_in'
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/activesupport-3.0.8.rc2/lib/active_support/dependencies.rb:225:in `load_dependency'
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/activesupport-3.0.8.rc2/lib/active_support/dependencies.rb:239:in `require'
from /Users/jade/code/plantworking/config.ru:3
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/rack-1.2.3/lib/rack/builder.rb:46:in `instance_eval'
from /Users/jade/.rvm/gems/ree-1.8.7-2010.02@plantworking/gems/rack-1.2.3/lib/rack/builder.rb:46:in `initialize'
from /Users/jade/code/plantworking/config.ru:1:in `new'
from /Users/jade/code/plantworking/config.ru:1
我正在使用Mongoid 2.0.2。
任何人都可以使用Rails 3.0.8+处理回形针吗?
答案 0 :(得分:0)
PaperClip仅适用于ActiveRecord。您可能需要尝试mongoid version of PaperClip或切换到Carrierwave。