Undefined method `application' for Rails:Module (NoMethodError)

Can someone help me ?

➜ blabla git:(master) ✗ rails console
/home/thomasleoty/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/application.rb:118:in ensure in preload': undefined methodapplication’ for Rails:Module (NoMethodError)
from /home/thomasleoty/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/application.rb:122:in preload' from /home/thomasleoty/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/application.rb:153:inserve’
from /home/thomasleoty/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/application.rb:141:in block in run' from /home/thomasleoty/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/application.rb:135:inloop’
from /home/thomasleoty/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/application.rb:135:in run' from /home/thomasleoty/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/application/boot.rb:19:in<top (required)>’
from /usr/share/rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in require' from /usr/share/rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:inrequire’
from -e:1:in `’

Gemfile

gem ‘rails’, ‘~> 5.2.1’

Use sqlite3 as the database for Active Record

gem ‘sqlite3’

Use Puma as the app server

gem ‘puma’, ‘~> 3.11’

Use SCSS for stylesheets

gem ‘sass-rails’, ‘~> 5.0’

Use Uglifier as compressor for JavaScript assets

gem ‘uglifier’, ‘>= 1.3.0’

See GitHub - rails/execjs: Run JavaScript code from Ruby for more supported runtimes

gem ‘mini_racer’, platforms: :ruby

gem ‘json’

Use CoffeeScript for .coffee assets and views

gem ‘coffee-rails’, ‘~> 4.2’

Turbolinks makes navigating your web application faster. Read more: GitHub - turbolinks/turbolinks: Turbolinks makes navigating your web application faster

gem ‘turbolinks’, ‘~> 5’

Build JSON APIs with ease. Read more: GitHub - rails/jbuilder: Jbuilder: generate JSON objects with a Builder-style DSL

gem ‘jbuilder’, ‘~> 2.5’

Use Redis adapter to run Action Cable in production

gem ‘redis’, ‘~> 4.0’

Use ActiveModel has_secure_password

gem ‘bcrypt’, ‘~> 3.1.7’

Use ActiveStorage variant

gem ‘mini_magick’, ‘~> 4.8’

Use Capistrano for deployment

gem ‘capistrano-rails’, group: :development

Reduces boot times through caching; required in config/boot.rb

gem ‘bootsnap’, ‘>= 1.1.0’, require: false

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]
end

group :development do

Access an interactive console on exception pages or by calling ‘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: GitHub - rails/spring: Rails application preloader

gem “spring”, group: :development

gem ‘spring-watcher-listen’, ‘~> 2.0.0’
end

group :test do

Adds support for Capybara system testing and selenium driver

gem ‘capybara’, ‘>= 2.15’
gem ‘selenium-webdriver’

Easy installation and use of chromedriver to run system tests with Chrome

gem ‘chromedriver-helper’
end

Windows does not include zoneinfo files, so bundle the tzinfo-data gem

gem ‘tzinfo-data’, platforms: [:mingw, :mswin, :x64_mingw, :jruby]

Hello @tleoty,

I would suggest to re-install the spring gem and try again.

  1. Uninstall spring:
gem uninstall spring
  1. Install it again:
gem install spring
  1. Test it once again.

Please let us know about the result.