spring-commands-rspec icon indicating copy to clipboard operation
spring-commands-rspec copied to clipboard

FYI: On Rails 7 & Ruby 3, $ rails console occurs an error

Open nikukyugamer opened this issue 3 years ago • 2 comments
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.

nikukyugamer avatar Jan 04 '22 09:01 nikukyugamer

Let me know if you found the solution.

sasharevzin avatar May 04 '22 02:05 sasharevzin

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

p8 avatar Jun 17 '22 19:06 p8