gpt4 book ai didi

ruby-on-rails - ActiveRecord::Extensions::SqliteRegexp:Class 的未定义方法 class_inheritable_accessor

转载 作者:太空宇宙 更新时间:2023-11-03 17:25:36 24 4
gpt4 key购买 nike

我最近安装了“ar-extension”gem。安装后,当我运行 rails crails s 时出现以下错误:

/usr/local/rvm/gems/ruby-1.9.2-p320/gems/ar-extensions-0.9.2/lib/ar-extensions/extensions.rb:427:in `<class:SqliteRegexp>': undefined method `class_inheritable_accessor' for ActiveRecord::Extensions::SqliteRegexp:Class (NoMethodError)
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/ar-extensions-0.9.2/lib/ar-extensions/extensions.rb:426:in `<module:Extensions>'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/ar-extensions-0.9.2/lib/ar-extensions/extensions.rb:112:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in `require'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in `block in require'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:236:in `load_dependency'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in `require'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/ar-extensions-0.9.2/init.rb:10:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in `require'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in `block in require'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:236:in `load_dependency'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in `require'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/ar-extensions-0.9.2/lib/ar-extensions.rb:5:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler/runtime.rb:68:in `require'
from /usr/local/rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /usr/local/rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler/runtime.rb:66:in `each'
from /usr/local/rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler/runtime.rb:66:in `block in require'
from /usr/local/rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler/runtime.rb:55:in `each'
from /usr/local/rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler/runtime.rb:55:in `require'
from /usr/local/rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler.rb:119:in `require'
from /home/infibeam/Aptana_studio_3/workspace/DigitalAssetManagement/config/application.rb:7:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.6/lib/rails/commands.rb:53:in `require'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.6/lib/rails/commands.rb:53:in `block in <top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.6/lib/rails/commands.rb:50:in `tap'
from /usr/local/rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.6/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'

我用谷歌搜索错误但徒劳无功..请帮助我知道到底出了什么问题。

最佳答案

您尝试使用的 gem 与 rails 3.2 不兼容。 class_inheritable_accessor 已被弃用,取而代之的是 class_attribute

你可以寻找这个 gem 的 rails 3.2 fork,做你自己的端口,或者搜索替代品。

关于ruby-on-rails - ActiveRecord::Extensions::SqliteRegexp:Class 的未定义方法 class_inheritable_accessor,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12313621/

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