gpt4 book ai didi

ruby-on-rails - Octopus gem 中的 rails 错误中类 `announce' (NameError) 的未定义方法 `Class'

转载 作者:行者123 更新时间:2023-12-03 20:46:08 24 4
gpt4 key购买 nike

在包含数据库分片 gem octopus 后出现以下错误在我的申请中......任何人都可以帮助我吗?......

/usr/lib/ruby/gems/1.8/gems/activesupport-3.1.0/lib/active_support/core_ext/module/aliasing.rb:31:in `alias_method': undefined method `announce' for class `Class' (NameError)
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.1.0/lib/active_support/core_ext/module/aliasing.rb:31:in `alias_method_chain'
from /usr/lib/ruby/gems/1.8/gems/ar-octopus-0.3.4/lib/octopus/migration.rb:9:in `extended'
from /usr/lib/ruby/gems/1.8/gems/ar-octopus-0.3.4/lib/octopus/migration.rb:73:in `extend'
from /usr/lib/ruby/gems/1.8/gems/ar-octopus-0.3.4/lib/octopus/migration.rb:73
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223:in `load_dependency'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:640:in `new_constants_in'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223:in `load_dependency'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /usr/lib/ruby/gems/1.8/gems/ar-octopus-0.3.4/lib/octopus.rb:66
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `require'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `require'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `each'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `require'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `each'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `require'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.21/lib/bundler.rb:122:in `require'
from /var/www/scandetails/config/application.rb:7
from /usr/lib/ruby/gems/1.8/gems/railties-3.1.0/lib/rails/commands.rb:38:in `require'
from /usr/lib/ruby/gems/1.8/gems/railties-3.1.0/lib/rails/commands.rb:38
from script/rails:6:in `require'
from script/rails:6

最佳答案

根据 this pull request ,Rails 3.1 支持已添加到 gem 的 master 分支,但更新版本 has not be released .您可以通过在 Gemfile 中引用 github 存储库,将存储库的 master 分支用作 gem 的源:

gem 'ar-octopus', :git => "git://github.com/tchandy/octopus.git", :require => "octopus"

关于ruby-on-rails - Octopus gem 中的 rails 错误中类 `announce' (NameError) 的未定义方法 `Class',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7819933/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com