spring-commands-rspec
spring-commands-rspec copied to clipboard
FYI: On Rails 7 & Ruby 3, $ rails console occurs an error
trafficstars
On Rails 7 and Ruby 3, executing $ rails console occurs this error.
$ bin/rails console
/myapp/vendor/bundle/ruby/3.1.0/gems/spring-2.1.1/lib/spring/application.rb:103:in `block in preload': undefined method `mechanism=' for ActiveSupport::Dependencies:Module
ActiveSupport::Dependencies.mechanism = :load
^^^^^^^^^^^^ (NoMethodError)
I removed gem 'spring-commands-rspec', spring and spring-watcher-listen from Gemfile and $ bundle install so it worked correctly.
Let me know if you found the solution.
You'll need to update spring to at least 3.0.0: https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#upgrading-from-rails-6-1-to-rails-7-0-spring