Error uninitialized constant ActiveSupport :: EventedFileUpdateChecker (NameError) in Rails

1

When I try to create something, I get the following error in the console:

  

marcom@marcom-Lenovo-G40-80:~/Escritorio/APPI$ rails g controller asd /home/marcom/Escritorio/APPI/config/environments/development.rb:53:in block in ': uninitialized constant   ActiveSupport :: EventedFileUpdateChecker (NameError) from   /home/marcom/.rvm/gems/ruby-2.3.3/gems/railties-4.2.7.1/lib/rails/railtie.rb:210:in    instance_eval' from /home/marcom/.rvm/gems/ruby-2.3.3/gems/railties-4.2.7.1/lib/rails/railtie.rb:210:in configure 'from   /home/marcom/Desktop/APPI/config/environments/development.rb:1:in    <top (required)>' from /home/marcom/.rvm/gems/ruby-2.3.3/gems/railties-4.2.7.1/lib/rails/engine.rb:598:in block (2 levels) in 'from   /home/marcom/.rvm/gems/ruby-2.3.3/gems/railties-4.2.7.1/lib/rails/engine.rb:597:in    each' from /home/marcom/.rvm/gems/ruby-2.3.3/gems/railties-4.2.7.1/lib/rails/engine.rb:597:in block in 'from   /home/marcom/.rvm/gems/ruby-2.3.3/gems/railties-4.2.7.1/lib/rails/initializable.rb:30:in    instance_exec' from /home/marcom/.rvm/gems/ruby-2.3.3/gems/railties-4.2.7.1/lib/rails/initializable.rb:30:in run 'from   /home/marcom/.rvm/gems/ruby-2.3.3/gems/railties-4.2.7.1/lib/rails/initializable.rb:55:in    block in run_initializers' from /home/marcom/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:228:in block in tsort_each 'from   /home/marcom/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:350:in    block (2 levels) in each_strongly_connected_component' from /home/marcom/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:422:in block (2 levels) in each_strongly_connected_component_from 'from   /home/marcom/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:431:in    each_strongly_connected_component_from' from /home/marcom/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:421:in block in each_strongly_connected_component_from 'from   /home/marcom/.rvm/gems/ruby-2.3.3/gems/railties-4.2.7.1/lib/rails/initializable.rb:44:in    each' from /home/marcom/.rvm/gems/ruby-2.3.3/gems/railties-4.2.7.1/lib/rails/initializable.rb:44:in tsort_each_child 'from   /home/marcom/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:415:in    call' from /home/marcom/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:415:in each_strongly_connected_component_from 'from   /home/marcom/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:349:in    block in each_strongly_connected_component' from /home/marcom/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:347:in each 'from   /home/marcom/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:347:in    call' from /home/marcom/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:347:in each_strongly_connected_component 'from   /home/marcom/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:226:in    tsort_each' from /home/marcom/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:205:in tsort_each 'from   /home/marcom/.rvm/gems/ruby-2.3.3/gems/railties-4.2.7.1/lib/rails/initializable.rb:54:in    run_initializers' from /home/marcom/.rvm/gems/ruby-2.3.3/gems/railties-4.2.7.1/lib/rails/application.rb:352:in initialize! ' desde   /home/marcom/Desktop/APPI/config/environment.rb:5:in <top (required)>' from /home/marcom/.rvm/gems/ruby-2.3.3/gems/spring-2.0.1/lib/spring/application.rb:92:in require 'from   /home/marcom/.rvm/gems/ruby-2.3.3/gems/spring-2.0.1/lib/spring/application.rb:92:in    preload' from /home/marcom/.rvm/gems/ruby-2.3.3/gems/spring-2.0.1/lib/spring/application.rb:143:in serve 'from   /home/marcom/.rvm/gems/ruby-2.3.3/gems/spring-2.0.1/lib/spring/application.rb:131:in    block in run' from /home/marcom/.rvm/gems/ruby-2.3.3/gems/spring-2.0.1/lib/spring/application.rb:125:in loop 'from   /home/marcom/.rvm/gems/ruby-2.3.3/gems/spring-2.0.1/lib/spring/application.rb:125:in    run' from /home/marcom/.rvm/gems/ruby-2.3.3/gems/spring-2.0.1/lib/spring/application/boot.rb:19:in 'from   /home/marcom/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in    require' from /home/marcom/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require 'from -e: 1: in' '

    
asked by Bryan 02.02.2017 в 21:45
source

1 answer

0

The problem is that ActiveSupport::EventedFileUpdateChecker was introduced in Rails 5. If you downloaded version just changing the version of rails in your Gemfile , it will clearly cause problems, because the configuration files are still made for rails 5 .
You have two options, the first is to comment / delete the configuration line that is causing you the problem:

#config/environments/development.rb
config.file_watcher = ActiveSupport::EventedFileUpdateChecker

The second is that you simply start a rails project with rails new tuproyecto from scratch. Notice what version of rails you are using with rails -v and make sure you are creating the project with version 5.x.

Personally I would recommend, especially if you are just starting your project, the second option, since commenting on this line does not assure you that you may have other problems later because of new features introduced in rails 5.x and not in 4.x

    
answered by 03.02.2017 / 20:46
source