更新后的 ruby​​ 和所有 gem 现在在我的 arity 项目上出现错误

发布于 2025-01-12 09:57:40 字数 3454 浏览 6 评论 0原文

`build_scope': undefined method `arity' for {:class_name=>"User", :optional=>true}:Hash (NoMethodError)

根据设计声明了解这一点:

class User < ApplicationRecord
  rolify
  # Include default devise modules. Others available are:
  # :timeoutable, :omniauthable, :confirmable, :registerable
  devise \
    :database_authenticatable,
    :recoverable,
    :rememberable,
    :trackable,
    :validatable,
    :lockable,
    :invita

Gemfile:

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 7.0.2'
# Use postgresql as the database for Active Record
gem 'pg', '~> 1.3', '>= 1.3.3'
# Use Puma as the app server 
gem 'puma', '~> 3.7'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# Turbolinks makes navigating your web application faster. Read more: 
https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
gem 'jquery-rails'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use ActiveModel has_secure_password
gem 'bcrypt', '~> 3.1.7'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

# Font Awesome Icons
gem 'font-awesome-sass', '~> 5.0.13'

# User Roles and permissions
gem 'devise'
gem 'devise_invitable', '~> 1.7.0'
gem 'pundit'
gem 'rolify'

# Image uploading
gem 'carrierwave', '~> 1.0'
gem 'mini_magick', '~> 4.3'
gem 'fog-aws'
gem 'remotipart', '~> 1.2'

# Nested Forms
gem "cocoon"

# Text Editor
gem 'ckeditor'

# CLI for rake tasks
gem 'highline'

# Friendly Time Display
gem 'local_time'

# Record Duplicaiton
gem 'amoeba'

# For ordering of lists
gem 'acts_as_list'

# For Scheduling Cron Jobs
gem 'whenever', require: false

# For App Settings
gem "rails-settings-cached"

# For PDF Generation
gem 'wicked_pdf'
gem 'wkhtmltopdf-binary-edge', '~> 0.12.5.1'

# Inline editing
gem "best_in_place", git: "https://github.com/mmotherwell/best_in_place"

# HTTP Calls
gem 'rest-client'

# Charts
gem 'chart-js-rails'

# toastr

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
  # Adds support for Capybara system testing and selenium driver
  gem 'capybara', '~> 2.13'
  gem 'selenium-webdriver'
  gem 'rails_real_favicon'
end

group :development do
  # Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
  gem 'web-console', '>= 3.3.0'
  gem 'listen', '>= 3.0.5', '< 3.2'
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

我已经尝试了所有捆绑安装和捆绑更新。删除了 gemlock 文件。这是使用 Zsh 在 MAC OS Montery 上全新安装的所有最新更新。不知道这里还能放什么,很乐意根据需要提供更多。

真的被困在这里,尝试了我在网上找到的所有方法,但没有任何帮助。

谢谢!

`build_scope': undefined method `arity' for {:class_name=>"User", :optional=>true}:Hash (NoMethodError)

Getting this on what looks to the devise statement:

class User < ApplicationRecord
  rolify
  # Include default devise modules. Others available are:
  # :timeoutable, :omniauthable, :confirmable, :registerable
  devise \
    :database_authenticatable,
    :recoverable,
    :rememberable,
    :trackable,
    :validatable,
    :lockable,
    :invita

Gemfile:

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 7.0.2'
# Use postgresql as the database for Active Record
gem 'pg', '~> 1.3', '>= 1.3.3'
# Use Puma as the app server 
gem 'puma', '~> 3.7'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# Turbolinks makes navigating your web application faster. Read more: 
https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
gem 'jquery-rails'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use ActiveModel has_secure_password
gem 'bcrypt', '~> 3.1.7'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

# Font Awesome Icons
gem 'font-awesome-sass', '~> 5.0.13'

# User Roles and permissions
gem 'devise'
gem 'devise_invitable', '~> 1.7.0'
gem 'pundit'
gem 'rolify'

# Image uploading
gem 'carrierwave', '~> 1.0'
gem 'mini_magick', '~> 4.3'
gem 'fog-aws'
gem 'remotipart', '~> 1.2'

# Nested Forms
gem "cocoon"

# Text Editor
gem 'ckeditor'

# CLI for rake tasks
gem 'highline'

# Friendly Time Display
gem 'local_time'

# Record Duplicaiton
gem 'amoeba'

# For ordering of lists
gem 'acts_as_list'

# For Scheduling Cron Jobs
gem 'whenever', require: false

# For App Settings
gem "rails-settings-cached"

# For PDF Generation
gem 'wicked_pdf'
gem 'wkhtmltopdf-binary-edge', '~> 0.12.5.1'

# Inline editing
gem "best_in_place", git: "https://github.com/mmotherwell/best_in_place"

# HTTP Calls
gem 'rest-client'

# Charts
gem 'chart-js-rails'

# toastr

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
  # Adds support for Capybara system testing and selenium driver
  gem 'capybara', '~> 2.13'
  gem 'selenium-webdriver'
  gem 'rails_real_favicon'
end

group :development do
  # Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
  gem 'web-console', '>= 3.3.0'
  gem 'listen', '>= 3.0.5', '< 3.2'
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

I have tried all the bundle installs and bundle updates. removed the gemlock file. This is afresh install with all the most recents updates on MAC OS Montery using Zsh. Not sure what else to put here happy to give more as needed.

Really stuck here have tried everything I find online but nothing helps.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

吐个泡泡 2025-01-19 09:57:40

好吧,我确实解决了这个问题 - 感谢 Jad 的回复。

问题出在我的 Gemfile 中:

gem 'devise'

gem 'devise_invitable', '~> 1.7.0'

但我已经更新到最新的设计,所以必须将其更改为:

gem 'devise'

gem 'devise_invitable', '~> 2.0.0'

然后我至少通过这个错误做到了。

Well, I did figure this one out - thanks to Jad for the response.

The issue was in my Gemfile I had:

gem 'devise'

gem 'devise_invitable', '~> 1.7.0'

But I had updated to the lastest devise, so had to change it to:

gem 'devise'

gem 'devise_invitable', '~> 2.0.0'

And then I made it by this error at least.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文