添加Paperclip.options [:command_path] =“/ usr / local / bin /”后的回形针问题

时间:2011-07-14 12:33:06

标签: ruby-on-rails

=> Booting Mongrel
=> Rails 2.3.5 application starting on http://0.0.0.0:3000
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010.  Use #requirement
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:1959:in `method_missing': undefined method `class_attribute' for ActiveRecord::Base:Class (NoMethodError)
    from /usr/lib/ruby/gems/1.8/gems/paperclip-2.3.14/lib/paperclip.rb:182:in `included'
    from /home/prabhu/Desktop/test/vendor/plugins/thoughtbot-paperclip-13d51e3/lib/paperclip/railtie.rb:20:in `include'
    from /home/prabhu/Desktop/test/vendor/plugins/thoughtbot-paperclip-13d51e3/lib/paperclip/railtie.rb:20:in `send'
    from /home/prabhu/Desktop/test/vendor/plugins/thoughtbot-paperclip-13d51e3/lib/paperclip/railtie.rb:20:in `insert'
    from /usr/lib/ruby/gems/1.8/gems/paperclip-2.3.14/rails/init.rb:2:in `evaluate_init_rb'
    from /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/plugin.rb:158:in `evaluate_init_rb'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
    from /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/plugin.rb:154:in `evaluate_init_rb'
    from /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/plugin.rb:48:in `load'
    from /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/plugin/loader.rb:38:in `load_plugins'
    from /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/plugin/loader.rb:37:in `each'
    from /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/plugin/loader.rb:37:in `load_plugins'
    from /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:369:in `load_plugins'
    from /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:165:in `process'
    from /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in `send'
    from /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in `run'
    from /home/prabhu/Desktop/test/config/environment.rb:9
    from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
    from /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/commands/server.rb:84
    from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from script/server:3

1 个答案:

答案 0 :(得分:1)

你没有问过一个问题,但我认为你有一些'class_attribute'未定义的问题。

我不确定(懒得检查;-),但有可能在Rails 3中添加了'class_attribute'。你有Rails 2和回形针gem。

您可以尝试使用此gem的旧版本 - 只需检查哪一个与Rails 2兼容。

更新:

正如您在评论中所读到的,David找到了一个定义了此方法的Rails版本。因此,您有两种选择:将Rails升级到至少2.3.9,或降级回形针。