Qualsiasi tentativo di eseguire rails console
nella directory principale della mia applicazione Rails produce il seguente errore:Rails errore di console: metodo non definito `ogni' per nil: NilClass (NoMethodError)
undefined method `each' for nil:NilClass (NoMethodError)
La traccia completa dello stack:
/Users/gnerkus/.rvm/gems/[email protected]/gems/railties-5.0.0.beta1.1/lib/rails/railtie.rb:245:in `each_registered_block': undefined method `each' for nil:NilClass (NoMethodError)
from /Users/gnerkus/.rvm/gems/[email protected]/gems/railties-5.0.0.beta1.1/lib/rails/railtie.rb:224:in `run_console_blocks'
from /Users/gnerkus/.rvm/gems/[email protected]/gems/railties-5.0.0.beta1.1/lib/rails/application.rb:461:in `block in run_console_blocks'
from /Users/gnerkus/.rvm/gems/[email protected]/gems/railties-5.0.0.beta1.1/lib/rails/engine/railties.rb:13:in `each'
from /Users/gnerkus/.rvm/gems/[email protected]/gems/railties-5.0.0.beta1.1/lib/rails/engine/railties.rb:13:in `each'
from /Users/gnerkus/.rvm/gems/[email protected]/gems/railties-5.0.0.beta1.1/lib/rails/application.rb:461:in `run_console_blocks'
from /Users/gnerkus/.rvm/gems/[email protected]/gems/railties-5.0.0.beta1.1/lib/rails/engine.rb:442:in `load_console'
from /Users/gnerkus/.rvm/gems/[email protected]/gems/railties-5.0.0.beta1.1/lib/rails/commands/console.rb:34:in `initialize'
from /Users/gnerkus/.rvm/gems/[email protected]/gems/railties-5.0.0.beta1.1/lib/rails/commands/console_helper.rb:9:in `new'
from /Users/gnerkus/.rvm/gems/[email protected]/gems/railties-5.0.0.beta1.1/lib/rails/commands/console_helper.rb:9:in `start'
from /Users/gnerkus/.rvm/gems/[email protected]/gems/railties-5.0.0.beta1.1/lib/rails/commands/commands_tasks.rb:78:in `console'
from /Users/gnerkus/.rvm/gems/[email protected]/gems/railties-5.0.0.beta1.1/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from /Users/gnerkus/.rvm/gems/[email protected]/gems/railties-5.0.0.beta1.1/lib/rails/command.rb:20:in `run'
from /Users/gnerkus/.rvm/gems/[email protected]/gems/railties-5.0.0.beta1.1/lib/rails/commands.rb:19:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
ho rintracciato l'errore a questo blocco nel file railtie.rb
nella lib Rails:
def each_registered_block(type, &block)
klass = self.class
while klass.respond_to?(type)
# The ':console' type doesn't seem to exist
klass.public_send(type).each(&block)
klass = klass.superclass
end
end
che a sua volta deriva da questo blocco:
def run_console_blocks(app) #:nodoc:
each_registered_block(:console) { |block| block.call(app) }
end
ho disinstallato il spring
gemma e installato il rubocop
gemma. Altrimenti, il mio Gemfile
contiene le gemme predefinite.
mio Ruby è 2.2.3
che è sopra la versione 2.2.2
consigliata per Rails 5.
Rubino versione:2.2.3p173
Rails versione: La versione5.0.0.beta1.1
RVM:1.26.11
puoi pubblicare la traccia stack completo per favore? –