'updated ruby and all gems now getting error on my project on arity
`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!
Solution 1:[1]
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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | ouflak |
